The problem occurs when you name the file same as the cmdlet. Renaming the filename to a different name resolves the issue.
For more information: https://stackoverflow.com/a/65720174/11292785
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am trying to run a powershell script using Startup in a Group Policy. I have mapped the script in Powershell Scripts Tab under Startup section of the GPO. The script contains a one liner command to set the TimeZone information. Below is the code:
Set-TimeZone -Id "India Standard Time"
Below is the error msg:
Error Message = The script failed due to call depth overflow.
Fully Qualified Error ID = CallDepthOverflow
Context:
Severity = Warning
Host Name = ConsoleHost
Host Version = 5.1.17763.592
Host ID = 836b5c03-9d27-402c-b8da-a169188ff709
Host Application = -ExecutionPolicy ByPass -File Set-TimeZone.ps1
Engine Version = 5.1.17763.592
Runspace ID = 23e7e0db-3eb1-404c-828d-aefbd89b8e01
Pipeline ID = 1
Command Name =
Command Type =
Script Name =
Command Path =
Sequence Number = 26
User = LION\SYSTEM
Connected User =
Shell ID = Microsoft.PowerShell
Thanks,
Rajiv
The problem occurs when you name the file same as the cmdlet. Renaming the filename to a different name resolves the issue.
For more information: https://stackoverflow.com/a/65720174/11292785