My script has been working well, up until the part where it executes the below code.
Show-InstallationRestartPrompt -Countdownseconds 240 -CountdownNoHideSeconds 30
Start-Sleep -Seconds 15 #JIC
Exit-Script -ExitCode 1641 # 1641 = Hard-Reboot
I get an pop-up error from the Toolkit log below. I’m using an interactive install with Intune, so I’m not sure why “Nosilentrestart” is a needed variable.
The old MSI gets removed correctly and the new updated MSI get installed. Its only this last detail that Im stuck on. I need the prompted reboot to happen as the MSI needs a reboot to finish install. Any help would be great. Thanks
Message : Cannot process argument transformation on parameter 'NoSilentRestart'. Cannot convert value
"System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers,
such as $True, $False, 1 or 0.
InnerException : System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert value
"System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers,
such as $True, $False, 1 or 0. ---> System.Management.Automation.PSInvalidCastException: Cannot
convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values
and numbers, such as $True, $False, 1 or 0.
at System.Management.Automation.ArgumentTypeConverterAttribute.ThrowPSInvalidBooleanArgumentCastExc
eption(Type resultType, Type convertType)
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics
engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet)
--- End of inner exception stack trace ---
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics
engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal
parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
FullyQualifiedErrorId : ParameterArgumentTransformationError,Show-InstallationRestartPrompt
ScriptStackTrace : at <ScriptBlock>,
C:\WINDOWS\IMECache\99cd0bb1-4609-48d4-a60e-9c13c6a1b2d9_13\Deploy-Application.ps1: line 231
at <ScriptBlock>, <No file>: line 1
at <ScriptBlock>, <No file>: line 1
PositionMessage : At C:\WINDOWS\IMECache\99cd0bb1-4609-48d4-a60e-9c13c6a1b2d9_13\Deploy-Application.ps1:231 char:84
+ ... -Countdownseconds 3600 -CountdownNoHideSeconds 30 Start-Sleep -Second ...
+ ~~~~~~~~~~~
Error Inner Exception(s):
-------------------------
Message : Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean
values and numbers, such as $True, $False, 1 or 0.
InnerException : System.Management.Automation.PSInvalidCastException: Cannot convert value "System.String" to type
"System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1
or 0.
at System.Management.Automation.ArgumentTypeConverterAttribute.ThrowPSInvalidBooleanArgumentCastExc
eption(Type resultType, Type convertType)
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics
engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message : Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean
values and numbers, such as $True, $False, 1 or 0.
InnerException :