Skip to content

Instantly share code, notes, and snippets.

@AdamGrossTX
Last active October 18, 2019 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamGrossTX/afb1c876b8fd4e0d6df7645a681b4390 to your computer and use it in GitHub Desktop.
Save AdamGrossTX/afb1c876b8fd4e0d6df7645a681b4390 to your computer and use it in GitHub Desktop.
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command " & {
$TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop;
$TSProgressUI = new-object -comobject Microsoft.SMS.TSProgressUI -ErrorAction Stop;
$TSProgressUI.ShowErrorDialog(
$TSEnv.Value(\"_SMSTSOrgName\"),
$TSEnv.Value(\"_SMSTSPackageName\"),
\"Windows Installation Error.\",
\"An error occurred while installing Windows. Please contact the IT Help Desk and provide the following information:`r`nFailed Step Name: $($TSEnv.Value(\"PhailedStepName\"))`r`nFailed Step Error Code: $([math]::abs($TSEnv.Value(\"PhailedStepReturnCode\")))\",
[math]::abs($TSEnv.Value(\"PhailedStepReturnCode\")),
$Tsenv.Value(\"SMSTSErrorDialogTimeout\"),
0,
$TSEnv.Value(\"PhailedStepName\")
);
Exit $TSEnv.Value(\"FailedStepReturnCode\")}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment