A cmdlet is a light command used in the Windows PowerShell environment. The Windows PowerShell runtime calls these cmdlets in the context of the automation scripts provided on the command line. Windows PowerShell runtime also calls them programmatically through Windows PowerShell APIs. In today’s release, we will identify the cause and then provide the solution to the problem of signed PowerShell cmdlets running slower than unsigned cmdlets on Windows.
Cmdlets perform an action and typically return a Microsoft .NET Framework object to the next command in the pipeline. To write a cmdlet, you must implement a cmdlet class that derives from one of two basic classes of specialized cmdlets. The derived class must:
- Declare an attribute that identifies the derived class as a cmdlet.
- Define public properties decorated with attributes that identify public properties as cmdlet parameters.
- Replace one or more of the input processing methods to process the records.
Signed PowerShell cmdlets run slower than unsigned cmdlets
You will notice that signed Windows PowerShell cmdlets run slower than unsigned cmdlets.
This problem occurs because the computer cannot connect to the following addresses for verification of the trusted certificate list (CTL):
http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/disallowedcertstl.cab http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab
This happens when a network problem exists. For example, there are incorrect proxy settings.
To work around this problem, follow these steps:
Computer Configuration> Windows Settings> Security Settings> Public Key Policies
- In the information pane on the right, double-click Certificate path validation settings.
- Select the Network recovery tongue.
- Check the Define these policy settings check box.
- Uncheck the box Automatically update certificates in Microsoft root certificate program (recommended) check box.
- Click on Apply > OKAY.
You can now exit the Local Group Policy Editor.
That’s it!