# Windows: Using Windows PowerShell or PowerShell Core
# Download
Invoke-WebRequest -Uri https://winbootstrap.saltproject.io -OutFile C:Tempootstrap-salt.ps1
Invoke-WebRequest -Uri https://winbootstrap.saltproject.io/sha256 -OutFile C:Tempootstrap-salt-sha256
# Verify file integrity
$FileSha = (Get-FileHash C:Tempootstrap-salt.ps1).hash
$ValidatedSha = Get-Content C:Tempootstrap-salt-sha256
if ("$FileSha" -eq "$ValidatedSha") {
# After verification, run Windows minion install
Write-Output "Success! Installing..."
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
C:Tempootstrap-salt.ps1
Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser
} else {
# If hash check fails, don't attempt install
Write-Error "WARNING: This file is corrupt or has been tampered with."
}