Reply To: Problem with executing scripts (Windows)

AvatarCatherine George
2 pts

A pleasure to be of help @Delilah,

Often, the error mentioned earlier ‘The term _____ is not recognized as the name of a cmdlet, function, script file, or operable program’ occurs when you attempt to run script commands on an unsupported CPU architecture type. Moreover, the scripts are run across 86-bit PowerShell on Windows devices when executed from the Hexnode portal. That’s why the script failed to execute.

If your script uses a module that requires the 64-bit version of PowerShell, you should specify it explicitly. For example, add the following commands to the beginning of your script to run it on 64-bit PowerShell.

Set-Alias Start-PowerShell64 "$env:windir\sysnative\WindowsPowerShell\v1.0\powershell.exe"  

Start-PowerShell64 command  

Also, there are other commands available that will help you force 64-PowerShell on the devices. You may use them accordingly.

I hope it helps,

Catherine George
Hexnode UEM