Powershell

Konfigurationen per Powershell durchführen

/src/salt/windows/powershell.sls
script:
  file.managed:
    - name: 'C:\Windows\Temp\reboot.ps1'
    - contents: |
        sleep 10
        Restart-Computer -Force

reboot:
  cmd.run:
    - name: Start-Process -NoNewWindow -FilePath "powershell" -ArgumentList "reboot.ps1" -WorkingDirectory "C:\Windows\temp"
    - shell: powershell
    - env:
      - ExecutionPolicy: bypass
    - user: Administrator

Last updated