Stdlib action reference

on this page

Stdlib actions are embedded in the preflight binary under the preflight/ namespace. A preflight/<name> ref resolves before project, cache, and Git refs. Each action has a version field, but the ref cannot pin it; upgrading the binary upgrades the stdlib.

yaml
tasks:
  - name: Machine baseline
    uses: preflight/windows-machine
    with:
      timezone: Eastern Standard Time

An input with no default in the tables below is required.

User-scoped settings in actions with a user input apply to the transport account when user is empty. When user is set, they are written to that user’s profile hive, which is loaded on demand if the user is signed out. See Configure another user’s settings.

preflight/autologin

Configures Windows automatic logon through the Winlogon registry key.

InputTypeDefaultDescription
usernamestringAccount to sign in as
passwordstring""Account password; accepts secret:<name>
domainstring.Domain; . for local accounts

preflight/git-sync

Clones or updates a Git repository on the target. The checkout is owned by the transport account. HTTPS and SSH credentials reach Git through environment variables, not the script text.

InputTypeDefaultDescription
repostringGit remote URL
destpathWorking tree directory
refstring""Branch, tag, or commit to check out
remotestringoriginRemote name
local_branchstring""Local branch to create or reset from ref
detachboolfalseCheck out ref as a detached HEAD
fetchbooltrueFetch when the repository exists
prunebooltruePrune deleted remote refs during fetch
fetch_tagsbooltrueFetch tags
resetbooltrueHard-reset the working tree to the resolved ref
cleanboolfalseRemove untracked files after checkout
clean_ignoredboolfalseAlso remove ignored files when clean is set
submodulesboolfalseInitialize and update submodules recursively
lfsboolfalseRun git lfs install and git lfs pull after checkout
depthint0Clone or fetch depth; 0 is full history
git_pathstringgitGit executable
create_parentbooltrueCreate the parent directory of dest
set_remote_urlbooltrueSet remote to repo before fetching
safe_directorybooltrueAdd dest to the global Git safe.directory list
http_usernamestringx-access-tokenHTTPS user name returned by askpass
http_passwordstring""HTTPS password or token returned by askpass
ssh_private_keystring""SSH private key content, used through a temporary GIT_SSH_COMMAND
ssh_known_hostsstring""Known hosts content used with ssh_private_key
ssh_strict_host_key_checkingbooltrueRequire SSH host key verification

preflight/windows-machine

Configures machine-wide settings.

InputTypeDefaultDescription
computer_namestring""Computer name; empty leaves it unchanged
timezonestring""Windows time zone ID; empty leaves it unchanged
enable_long_pathsbooltrueLong path policy
ps1_execution_policystringRemoteSignedLocalMachine PowerShell execution policy
disable_new_network_promptbooltrueDisable the new network prompt on first connection

preflight/windows-shell

Configures desktop, Explorer, taskbar, and Start settings for the selected user.

clear_desktop_shortcuts removes .lnk, .url, and .website files from the user’s Desktop folders, OneDrive desktop folders, and the public desktop, and hides the This PC, Network, and Control Panel desktop icons. Some changes take effect only after sign-out, an Explorer restart, or a reboot.

InputTypeDefaultDescription
userstring""Windows user to configure
clear_desktop_backgroundbooltrueClear the wallpaper
clear_desktop_shortcutsbooltrueRemove desktop shortcuts and hide common desktop icons
taskbar_auto_hideboolfalseTaskbar auto-hide
theme_modestringunchangedunchanged, light, or dark, applied to app and system surfaces
transparency_effectsbooltrueTransparency effects
hide_recycle_binbooltrueHide the Recycle Bin desktop icon
show_hidden_filesbooltrueShow hidden files in Explorer
show_file_extensionsbooltrueShow file extensions in Explorer
show_empty_drivesbooltrueShow empty removable drives in Explorer
show_sync_provider_notificationsboolfalseShow sync provider notifications in Explorer
aero_shakeboolfalseAero Shake window minimization
launch_to_this_pcbooltrueOpen Explorer to This PC instead of Quick Access
show_item_check_boxesboolfalseShow item check boxes in Explorer
taskbar_allow_resizebooltrueAllow taskbar resizing
taskbar_on_all_displaysboolfalseShow the taskbar on all displays
taskbar_allow_multimonbooltrueAllow the multi-monitor taskbar
hide_this_pc_foldersbooltrueHide Music, Pictures, Videos, and 3D Objects from This PC
disable_network_folder_thumbnailsbooltrueStop thumbnail caches on network folders
show_store_apps_on_taskbarboolfalseShow Microsoft Store apps on the taskbar
hide_spotlight_desktop_iconbooltrueHide the Windows Spotlight “Learn about this picture” desktop icon
clear_start_pinsboolfalseReplace Start pins with start_pins_json
start_pins_jsonstring{"pinnedList":[]}ConfigureStartPins JSON payload

preflight/windows-input

Configures touch, gesture, accessibility shortcut, and text scale settings. Edge swipe and touch edge-targeting policies are machine-scoped; the other settings apply to the selected user. Visual changes may take effect only after sign-out or an Explorer restart.

InputTypeDefaultDescription
userstring""Windows user to configure
disable_edge_gesturesbooltrueDisable screen-edge swipe gestures
disable_touch_feedbackbooltrueDisable touch contact visualization
disable_touch_gesturesbooltrueDisable gesture visualization
text_scale_percentint100Text size percentage
disable_accessibility_shortcutsbooltrueDisable the Sticky Keys, Filter Keys, and Toggle Keys shortcuts

preflight/windows-quiet-mode

Suppresses notifications, prompts, and error reporting UI. Notification policy, news and interests, error reporting, consumer features, and restart sign-on are machine-scoped. Notification center, toast, setup prompt, and app suggestion settings apply to the selected user.

InputTypeDefaultDescription
userstring""Windows user for user-scoped settings
disable_notificationsbooltrueDisable toast and cloud notifications
disable_news_and_interestsbooltrueDisable the news and interests feed
disable_error_reportingbooltrueDisable Windows Error Reporting UI and submission
disable_windows_setup_promptbooltrueDisable consumer and cloud-optimized Windows prompts
disable_app_restore_on_bootbooltrueDisable automatic restart sign-on after Windows Update restarts
disable_app_suggestionsbooltrueDisable consumer app suggestions and silent app installs

preflight/windows-update-lockdown

Limits Windows Update and Microsoft Store background changes. All settings are machine-scoped.

InputTypeDefaultDescription
disable_windows_updatebooltrueDisable automatic Windows Update checks by policy
disable_windows_update_servicebooltrueStop and disable the Windows Update, Update Orchestrator, and Windows Update Medic services
disable_update_auto_rebootbooltruePrevent automatic restarts while users are signed in
disable_store_auto_downloadbooltrueDisable Store app automatic downloads

preflight/windows-power

Manages a named power plan, hibernation, and the selected user’s screen saver. Screen saver changes may take effect only after sign-out.

InputTypeDefaultDescription
userstring""Windows user whose screen saver to configure
plan_namestringPreflight ExhibitManaged power plan name
plan_basestringbalancedPlan alias or GUID to clone
activate_planbooltrueActivate the managed plan
display_timeout_acint0Display timeout on AC power, in minutes; 0 is never
display_timeout_dcint0Display timeout on battery, in minutes; 0 is never
sleep_timeout_acint0Sleep timeout on AC power, in minutes; 0 is never
sleep_timeout_dcint0Sleep timeout on battery, in minutes; 0 is never
disable_screensaverbooltrueDisable the screen saver
disable_hibernationboolfalseDisable hibernation and remove hiberfil.sys

For a recurring reboot, use the scheduled_task module. See Schedule a Windows reboot.

preflight/debloat

Removes built-in Microsoft and third-party Store apps, uninstalls the OneDrive desktop client, and disables telemetry, activity history, advertising ID, Copilot, Recall, Bing and Cortana search, delivery optimization, and Game DVR. App removal and machine policies are not user-scoped. For a custom app list, use the remove_appx_packages module.

InputTypeDefaultDescription
userstring""Windows user for user-scoped privacy and taskbar settings

preflight/winget

Installs WinGet machine-wide and registers it for the transport account, so winget_package works over SSH and WinRM. Use it on editions that ship without WinGet, such as Windows IoT Enterprise LTSC, and for accounts that have never signed in interactively. The transport account must be an administrator.

InputTypeDefaultDescription
source_max_agestring24hRe-provision the winget source once its build is older than this, in s, m, h or d. 0 only provisions a missing source

The action runs three tasks:

  1. Provision App Installer: unless it is already provisioned, downloads the latest App Installer bundle and its dependencies for the target’s architecture from the winget-cli GitHub releases, then provisions them for all users.
  2. Provision the winget source: downloads source2.msix from the WinGet CDN and provisions it when it is missing or older than source_max_age.
  3. Register WinGet for the transport account: registers both packages by family name when App Installer is missing for the account, or its source is older than the provisioned one.

WinGet can’t install these packages for a remote session itself; per-user installs fail with 0x80073D19. Provisioning machine-wide, then registering, avoids that path.

  • The target needs internet access to GitHub and cdn.winget.microsoft.com.
  • The source is refreshed from the CDN. If the CDN build is older than source_max_age, the task reports changed on every run.
  • preflight check on a target without WinGet reports later winget_package tasks as failed, because the bootstrap has not run yet.

Known limitations:

  • App Installer comes from the winget-cli releases/latest download, unpinned and without a hash check. Each fresh provisioning takes whatever release is current.
  • The source guard only detects a missing Microsoft.Winget.Source package. A present but broken source isn’t detected or repaired.
yaml
tasks:
  - name: WinGet
    uses: preflight/winget
  - name: Tools
    winget_package:
      packages:
        - id: 7zip.7zip

preflight/chocolatey

Installs Chocolatey and configures its package sources, so choco_package works. The transport account must be an administrator.

InputTypeDefaultDescription
versionstring""Chocolatey version to install, 2.0 or later because choco_package rejects 1.x; empty installs the latest
sourceslist[]Sources to add or update. Each entry has name and url
remove_default_sourceboolfalseRemove the community source named chocolatey

The action runs two tasks:

  1. Install Chocolatey: when choco.exe is missing, downloads install.ps1 from community.chocolatey.org and runs it.
  2. Configure Chocolatey sources: adds each source in sources, or updates its URL and enables it, then removes the chocolatey source when remove_default_source is set.
  • The target needs internet access to community.chocolatey.org for the install.
  • version applies only to the install. An existing Chocolatey is not upgraded or downgraded.
  • Sources that are not listed are left alone, except chocolatey with remove_default_source.
  • Sources with credentials, priorities, or certificates aren’t supported. Add them with a powershell task.
  • preflight check on a target without Chocolatey reports later choco_package tasks as failed, because the bootstrap has not run yet.

Known limitations:

  • A partial ProgramData\chocolatey directory without bin\choco.exe makes the Chocolatey installer refuse to run, which blocks the bootstrap. Remove the directory first.
  • Pinning version below 2.0 installs a Chocolatey that choco_package then rejects. The input has no schema check for this.
  • Updating a source relies on choco source add replacing an existing source of the same name in place.
yaml
tasks:
  - name: Chocolatey
    uses: preflight/chocolatey
    with:
      sources:
        - name: internal
          url: https://nuget.example.com/chocolatey/
      remove_default_source: true
  - name: Tools
    choco_package:
      packages:
        - id: 7zip

preflight/scoop

Installs Scoop, git, and buckets for the transport account, so scoop_package works.

InputTypeDefaultDescription
bucketslist[]Buckets to add besides main. Each entry is a known bucket name, such as extras or versions, or an object with name and url

The action runs three tasks:

  1. Install Scoop: when scoop.cmd is missing from the account’s Scoop directory, downloads the installer from get.scoop.sh and runs it, with -RunAsAdmin when the account is an administrator.
  2. Install git for Scoop: when git.exe isn’t on the machine or user PATH, runs scoop install git.
  3. Add Scoop buckets: adds main and each bucket in buckets unless it is already a git clone. main is removed and added again when its directory isn’t a git clone, which happens after an install without git. Any other bucket directory that isn’t a git clone makes the add fail; delete it by hand.
  • The Scoop directory is %USERPROFILE%\scoop, or the user’s SCOOP environment variable when set. Only the user-scope SCOOP is honored; a machine-scope SCOOP isn’t supported.
  • The target needs internet access to get.scoop.sh and GitHub.
  • Changing the url of an existing bucket has no effect. Remove the bucket first.
  • The Scoop installer refuses to run when C:\ProgramData\scoop exists and is not empty, which happens once any account installs a global app. Preflight doesn’t install global apps.
  • preflight check on a target without Scoop reports later scoop_package tasks as failed, because the bootstrap has not run yet.
yaml
tasks:
  - name: Scoop
    uses: preflight/scoop
    with:
      buckets: [extras, versions]
  - name: Tools
    scoop_package:
      packages:
        - id: extras/vscode