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 { |
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
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
[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
#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
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
#Add-AzureRmAccount | |
#Get-AzureRmSubscription | |
#Set-AzureRmContext -SubscriptionName "" | |
$AzureWebSite = "" | |
$AzureResourceGroup = "" | |
$Resource = Get-AzureRmResource -ResourceType "microsoft.web/sites/config" -ResourceGroupName $AzureResourceGroup -ResourceName $AzureWebSite/web -ApiVersion "2016-08-01" | |
$Resource.Properties.virtualApplications[0].physicalPath = "site\wwwroot\" | |
$Resource | Set-AzureRmResource -Force -ApiVersion "2016-08-01" |
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
#Setting up variables of our WebApp | |
$AzureWebSite = "MySite" | |
$SourceSlot = "staging" | |
$DestinationSlot = "production" | |
$AzureResourceGroup = "MyResourceGroup" | |
#Swapping | |
Switch-AzureRmWebAppSlot -SourceSlotName $SourceSlot -DestinationSlotName $DestinationSlot -ResourceGroupName $AzureResourceGroup -Name $AzureWebSite | |
#Getting Hybrid Connections from staging slot |
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
# Clean old files | |
del composer_update_*.txt | |
# Start composer (we just let it timeout and redirect output and exit code to files) | |
composer update 1> composer_update_output.txt 2> composer_update_error.txt & echo %errorLevel% > composer_update_exitcode.txt | |
# Then we actively wait until exitcode file exist as a flag on execution end | |
if exist composer_update_exitcode.txt (echo exit) else (echo still running) | |
# Then we get the data from files |
OlderNewer