Category filter

Troubleshoot common scripting issues on Windows devices

1. ‘Execute Custom Script’ action still in the ‘In Progress’ state

Description: Some scripts remain in the ‘In progress’ state for a long time in the Action History page on the Hexnode portal.

Solution: The deployed script might require user interaction. Use codes that do not require any user or device UI interactions. Including the keywords -silent, -passive, -quiet, -nointeractive might make the code run silently on supported cmdlets.

2. Error when PowerShell tries to access the internet to download any file or module

Description: Deploying a script to download a file or a module returns the error, “Unable to download from URI ‘https://go.microsoft.com/fwlink/ ?LinkID=627338&clcid=0x409’ to ‘ ’.”

Cause: When PowerShell is not able to access the internet, it returns this error. This can be because the PowerShell might not be supporting TLS 1.2 protocol.

Solution: Force PowerShell to use TLS 1.2 with the PowerShell command:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 reason

3. “The term ‘xxx’ is not recognized as the term of a cmdlet, function, script file, or operable”

Description: Some commands that run fine on the terminal of the device, when included in a script, are not recognized.

Cause: Some commands only run on PowerShell x64. These commands will not be recognized when run in any other versions of PowerShell.

Solution: Force the commands to run on PowerShell x64. Include the following code snippet before the problematic commands in the script file:

  • Troubleshooting Guides