Powershell - Reboot and Continue Script

前端 未结 7 2048
误落风尘
误落风尘 2020-12-02 11:07

I\'m looking for a way to continue a Powershell script from where it left off after calling a reboot in the script. For example, I am building a DC via Powershell automation

7条回答
  •  庸人自扰
    2020-12-02 12:07

    Do it remotely:

    Rename-Computer -ComputerName $computer -NewName "TESTDC01" -DomainCredential $domain\$username -Force -Restart
    

    And continue your script from that 8)

提交回复
热议问题