Hi Team,
Recently we are intermittently facing issues while running the Powershell file via powershell.exe. This exists with error code 65536. The call to run the Powershell file is triggered by the console application.
The same command works perfectly fine with Powershell version 4.0. We have never faced any issue using that.
Powershell version:
Name Value
PSVersion 5.1.17763.1852
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1852
CLRVersion 4.0.30319.42000
Operating System: Windows Server 2019
Script:
$Key = "HKLM:\SOFTWARE\TestApp"
$Value = "TestKey"
If (Test-Path $Key) {
(Get-ItemProperty -Path $Key).$Value
}
Note: The issue is intermittently failing for different scripts. Nothing specifically to the above script.
Can someone please help?
Thanks!!