Created
August 16, 2017 10:43
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this and a zip with your startup items as an artifact