Skip to content

Commit

Permalink
Adds ANCM schema script (dotnet#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotalik committed Sep 27, 2017
1 parent 0de17f7 commit 8e083b2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions BuildAgent/SetupScripts/DeployANCMSchemas.ps1
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
}
}

0 comments on commit 8e083b2

Please sign in to comment.