forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
$agents = @("aspnetci-a-101") | ||
$sourcefile = "C:\code\aspnetcoremodule\src\AspNetCore\aspnetcore_schema.xml" | ||
$creds = Get-Credential "redmond\asplab" | ||
|
||
foreach ($agent in $agents) | ||
{ | ||
Write-Host $agent | ||
$remote = New-PSDrive -Name Remote -PSProvider FileSystem -Root "\\$agent\C$" -Credential $creds | ||
|
||
Try | ||
{ | ||
$destinationFolder = "${remote}:\temp\AspNetCoreModule" | ||
#This section will copy the $sourcefile to the $destinationfolder. If the Folder does not exist it will create it. | ||
if (!(Test-Path -path $destinationFolder)) | ||
{ | ||
New-Item $destinationFolder -Type Directory | ||
Write-Host "Directory created" $destinationFolder | ||
} | ||
Copy-Item -Path $sourcefile -Destination $destinationFolder | ||
Write-Host "Copied xml successfully" | ||
|
||
#Copy the schema files over | ||
Copy-Item -Path "${remote}:\temp\AspNetCoreModule\aspnetcore_schema.xml" -Destination "${remote}:\Program Files\IIS Express\config\schema\aspnetcore_schema.xml" -Force | ||
Copy-Item -Path "${remote}:\temp\AspNetCoreModule\aspnetcore_schema.xml" -Destination "${remote}:\Program Files (x86)\IIS Express\config\schema\aspnetcore_schema.xml" -Force | ||
Copy-Item -Path "${remote}:\temp\AspNetCoreModule\aspnetcore_schema.xml" -Destination "${remote}:\Windows\System32\inetsrv\config\schema\aspnetcore_schema.xml" -Force | ||
Write-Host "Copied schema successfully" | ||
} | ||
Finally | ||
{ | ||
Remove-PSDrive -Name Remote | ||
} | ||
} |