Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created September 8, 2015 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/178197ad7098696b53aa to your computer and use it in GitHub Desktop.
Save guitarrapc/178197ad7098696b53aa to your computer and use it in GitHub Desktop.
# sync "MyOneGetServer.Script" folder to wwwroot\MyOneGetServer.Script
$source = Join-Path (pwd).Path "MyOneGetServer.Script";
$destination = Join-Path $env:WEBROOT_PATH "MyOneGetServer.Script";
# create content path beforehand
if (-not (Test-Path $destination))
{
mkdir -Path $destination -Force;
}
try
{
# msdeploy can not be used. Use robocopy to sync folder
. Robocopy.exe $source $destination /MIR /FFT /Z /XA:H /W:5
exit 0
}
catch
{
Write-Error $_
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment