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
function CheckConfig($WebPath) | |
{ | |
$src = $WebPath + "Web.config" | |
$xdt = $WebPath + "Web.Azure-QA.config" | |
$temp = $WebPath + "Web.Temp.config" | |
Add-Type -Path "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.XmlTransform.dll" | |
try | |
{ | |
$doc = New-Object Microsoft.Web.XmlTransform.XmlTransformableDocument |
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
#vcsName: Only if you have two VCS or more, but it run you must set checkout rule +:.=> [vcsName] in VCS | |
$vcsName = "Main" | |
$webPath = "%teamcity.build.checkoutDir%/$vcsName" | |
#nugetVersion: Generate based on release name and build counter | |
$nugetVersion = "%env.nuget_version%" | |
$nugetId = "%octo.ProjectName%.$vcsName" | |
$octopusNugetRepo = "%OctopusNugetRepo%" | |
$octopusApiKey = "%OctopusApiKey%" | |
function GenerateWebNugets{ |
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
[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration") | |
$sm = New-Object Microsoft.Web.Administration.ServerManager | |
foreach($site in $sm.Sites) | |
{ | |
$root = $site.Applications | where { $_.Path -eq "/" } | |
Write-Output ("Site: " + $site.Name + " | Pool: " + $root.ApplicationPoolName) | |
} |
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
Import-Module Webadministration | |
Get-ChildItem -Path IIS:\Sites |
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
function CheckConfig($WebPath) | |
{ | |
$src = $WebPath + "Web.config" | |
$xdt = $WebPath + "Web.PROD.config" | |
$temp = $WebPath + "Web.Temp.config" | |
Add-Type -Path "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.XmlTransform.dll" | |
try | |
{ | |
$doc = New-Object Microsoft.Web.XmlTransform.XmlTransformableDocument |
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
$configFile = "D:\test\web.config" | |
[xml]$xml = Get-Content $configFile | |
$compilationAttrib = $xml.configuration.'system.web'.compilation.debug | |
if($compilationAttrib -eq "true"){ | |
Write-Error "Error: The debug compilation must not be true" | |
} | |
else { |
NewerOlder