Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param (
- [Parameter(Mandatory=$true)][string]$OutputDir
- )
- #Enable Remote Powershell
- winrm set winrm/config/client '@{TrustedHosts="DevWeb"}'
- #Stop IIS on the target server, required as .net core locks the files during runtime
- invoke-command -computername "DevWeb" -scriptblock {iisreset /stop}
- #Trigger robocopy to mirror the source and destination folder
- robocopy $OutputDir '\\DevWeb\d$\Website\' /mir /s /r:1 /w:1
- #Start iis on the target server
- invoke-command -computername "DevWeb" -scriptblock {iisreset}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement