Skip to content

Instantly share code, notes, and snippets.

@jasontucker
Created December 15, 2023 01:02
Show Gist options
  • Save jasontucker/077793497e4e26175f39428a20d528ac to your computer and use it in GitHub Desktop.
Save jasontucker/077793497e4e26175f39428a20d528ac to your computer and use it in GitHub Desktop.
$currentUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName
$username = $currentUser.Split('\')[1]
$userPrincipalName = $username + "@domain.net"
$TenantId = "xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx"
$AppId = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx"
$AppSecret = "xx-xx~xxxxxxx~xxxxxxxx.~xxxxxxx"
$GroupTag = "Pre-Provision"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$false -Force:$true
Install-Script get-windowsautopilotinfo -Confirm:$false -Force:$true
get-windowsautopilotinfo -Online -TenantId $TenantId -AppId $AppId -AppSecret $AppSecret -GroupTag $GroupTag -AssignedUser $userPrincipalName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment