Optimize Powershell in playbook

Hello,

I’m trying to get a playbook working that will run the Optimize Powershell script that is here: https://docs.ansible.com/ansible/latest/user_guide/windows_performance.html

The playbook succeeds, but when I check for one of the installed assemblies on a host, it shows as not installed.

Has anyone ever successfully done this? Is there a better way to get that script to run on all of my hosts (and any new ones as they come up)?

Hi

Can you please provide error msg which you have encountered while running the
Playbook ?

Thanks,
Vivek

Thanks for the reply.The task actually succeeds (shows as changed). But when I go to the host, the assemblies show as not installed.
The task does have a stderr output though:
Connecting to local system… Starting PSEXESVC service on local system… Connecting with PsExec service on windows-server… Starting powershell.exe on windows-server… powershell.exe exited on windows-server with error code 0.

This is what the server shows when I check for the installed assembly:
PS C:\Windows\system32> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe display C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.ISECommon\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.ISECommon.dll
Microsoft (R) CLR Native Image Generator - Version 4.8.3761.0
Copyright (c) Microsoft Corporation. All rights reserved.
Error: The specified assembly is not installed.