Skip to content

Instantly share code, notes, and snippets.

@Satak
Last active January 16, 2020 08:33
Show Gist options
  • Save Satak/69776adfa9f19eda2779375f52ac31ad to your computer and use it in GitHub Desktop.
Save Satak/69776adfa9f19eda2779375f52ac31ad to your computer and use it in GitHub Desktop.
param(
[string]$version,
$AllowRemoteExecution = $True
)
# install AV
$path = 'C:\av'
$fileName = 'output.txt'
$fullFilePath = (Join-Path -Path $path -ChildPath $fileName)
New-Item -ItemType Directory -Path $path
New-Item -ItemType File -Path $fullFilePath
$version | Set-Content $fullFilePath
# init data disks
Get-Disk | Where-Object {$_.PartitionStyle -eq 'RAW'} | Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume
if($AllowRemoteExecution) {
Enable-PSRemoting
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment