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)?


---
- name: Optimize Powershell
  hosts: all
  gather_facts: yes
  tasks:
    - name: Copy script
win_copy
        src: "{{fileserver}}\\Open\\Scripts\\Optimize-Powershell.ps1"
        dest: C:\temp\Optimize-Powershell.ps1
        remote_src: yes
    - name: Copy PsExec
      win_copy:
        src: "{{fileserver}}\\Open\\PSTools\\PsExec.exe"
        dest: c:\temp\psexec.exe
        remote_src: yes
- name: Run script through psexec
      win_psexec:
        command: 
"powershell.exe -executionpolicy bypass -noninteractive -nologo -file C:\\
temp\\Optimize-Powershell.ps1"
        executable: C:\temp\psexec.exe
        elevated: yes
        nobanner: yes
        interactive: yes
        username: "{{adminuser}}"
        password: "{{adminpass}}"

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d1d1b8af-1e52-4b93-8486-274cce948ce0%40googlegroups.com.

Reply via email to