forked from SteveF92/FantasyCritic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateSite.ps1
18 lines (18 loc) · 940 Bytes
/
UpdateSite.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dotnet publish -c Release -o C:\FantasyCritic\BuildArea\
Write-Output "Stopping site"
Stop-Website "FantasyCritic"
Write-Output "Deleting files"
while((Get-ChildItem "C:\FantasyCritic\Binary\" | Measure-Object).Count -gt 0)
{
Get-ChildItem C:\FantasyCritic\Binary\ -Recurse | Remove-Item -Recurse -Force
}
$numFiles = (Get-ChildItem "C:\FantasyCritic\Binary\" | Measure-Object).Count
Write-Output "Delete done, $numFiles in folder."
Write-Output "Copying files"
Copy-Item -Path "C:\FantasyCritic\BuildArea\*" -Destination "C:\FantasyCritic\Binary\" -Force -Recurse
Write-Output "Copying Items"
Copy-Item -Path "C:\Users\Administrator\Desktop\CopyFiles\appsettings.json" -Destination "C:\FantasyCritic\Binary\" -Force
Copy-Item -Path "C:\Users\Administrator\Desktop\CopyFiles\EmailTemplates" -Destination "C:\FantasyCritic\Binary\" -Force -Recurse
Write-Output "Starting site"
Start-Website "FantasyCritic"
Write-Output "Update finished"