[CmdletBinding()] param([string]$InstallRoot='', [switch]$PrepareOnly) $ErrorActionPreference='Stop' $env:PSModulePath=$env:WINDIR+'\System32\WindowsPowerShell\v1.0\Modules;'+$env:ProgramFiles+'\WindowsPowerShell\Modules' [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 $taskBootstrap=Join-Path $env:TEMP ('workbuddy-image-uninstall-'+[guid]::NewGuid().ToString()+'.ps1') Invoke-WebRequest -UseBasicParsing -Uri 'https://workbuddy.tongyuye.com/releases/3.0.1/bootstrap.ps1' -OutFile $taskBootstrap if((Get-FileHash -LiteralPath $taskBootstrap -Algorithm SHA256).Hash.ToLowerInvariant() -ne '71e90a463583b95a4892b4e5d8045244f2d72d1d6b5826b3ccb563ddf2b2ff0e'){throw 'Installer SHA256 mismatch'} $taskArgs=@{BaseUrl='https://workbuddy.tongyuye.com/releases/3.0.1';Uninstall=$true;PrepareOnly=$PrepareOnly} if($InstallRoot){$taskArgs.InstallRoot=$InstallRoot} & $taskBootstrap @taskArgs