Skip to content

Instantly share code, notes, and snippets.

@andrewiankidd
Created August 16, 2017 10:43
Show Gist options
  • Save andrewiankidd/bc9eca3e42cec47ca1917ea5ce5a819d to your computer and use it in GitHub Desktop.
Save andrewiankidd/bc9eca3e42cec47ca1917ea5ce5a819d to your computer and use it in GitHub Desktop.
Azure PS artifact for adding items to the startup folder of a VM
Write-Host "addStartupItems.ps1"
$cd = Get-Location;
$zipPath = "$cd\startupItems.zip"
$startupPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
$unzipPath = "$cd\startupUnzip"
if (Test-Path($unzipPath)){
Remove-Item -path $unzipPath -force -recurse
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
Write-Host "extracting startup-items to startup directory..."
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipPath, "$unzipPath")
copy "$unzipPath\*" "$startupPath\" -force -recurse
@andrewiankidd
Copy link
Author

Add this and a zip with your startup items as an artifact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment