Created
March 11, 2013 08:10
-
-
Save ThomasArdal/5132711 to your computer and use it in GitHub Desktop.
Remote creation of IIS websites.
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
$username = "insert_username_here" | |
$password = ConvertTo-SecureString "insert_password_here" -AsPlainText -Force | |
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$password | |
$session = New-PSSession "insert_hostname_here" -Credential $credential | |
Invoke-Command -Session $session -ScriptBlock { | |
Set-ExecutionPolicy RemoteSigned | |
Import-Module WebAdministration | |
New-Item iis:\Sites\%teamcity.build.branch%.insert_local_name_here -bindings @{protocol="http";bindingInformation=":80:%teamcity.build.branch%.insert_local_name_here"} -physicalPath c:\inetpub\wwwroot\%teamcity.build.branch%.insert_local_name_here | |
Set-ItemProperty 'IIS:\Sites\%teamcity.build.branch%.insert_local_name_here' ApplicationPool "ASP.NET v4.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment