Hi Folks,
Sometimes we are trying to execute some types of powerShell scripts, but powerShell don't support them.
Mostly, this type of issue is occured , when PowerShell version is not updated/ use old versions.
Here, we are done, how to upgrade the PowerShell.
- clear-host
- Clear-History
-
- $wshell = New-Object -ComObject Wscript.Shell
- $a=Get-Host
- $a.Version.Major
-
- if($a.Version.Major -lt 3)
- {
- Write-Host "Powershell Version is" $a.Version.Major -fore Yellow
- $a= $wshell.Popup("Powershell Version Mismatch, We are proceeding with the next step",0,"Powershell Version Mismatch")
-
- if($a.Equals(1))
- {
- $a= $wshell.Popup("Do u want to upgrade your powershell script and after that you need to restart the system for applying all the changes.",0,"Message",0x1)
- if($a.Equals(1))
- {
- Write-Host "test" -fore Red
- }
- }
- }
- else
- {
- write-host "test" -fore Red
- $wshell.Popup("Authentication failed - please verify your username and password.",0,"Done")
- }
After that powershell will be updated, then try to use your not ran script.