Deployment IIS from TFS

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Nitin Gupta Nitin Gupta 1 week, 1 day ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #54205
    Profile photo of Marcel Czech
    Marcel Czech

    Hello together,

    maybe some of you can help me. I m a newbie in powershell, and i have to make a script that deploy sources which droped on a tfs server on a iis webserver. on the end i have to execute a sql file on the specific database, which is also on the server stored. Can you tell me where i have to fill in the right parameters?

    Write-Host "`$env:PSModulePath=$($env:PSModulePath)"
    Write-Host "`$env:ProgramFiles=$($env:ProgramFiles)"
    Write-Host "`$CurrentValue=$CurrentValue"
    Write-Host "`$PSVersionTable.PSVersion=$($PSVersionTable.PSVersion)"
    Get-Module -ListAvailable
    Write-Host "`n`n==== DscResources ====="
    Get-DscResource | Select Name, Properties | ft -AutoSize 
    configuration Sample_xWebsite_NewWebsite 
            # Target nodes to apply the configuration 
            [string[]]$NodeName = 'localhost', 
            # Name of the website to create 
            [String]$WebSiteName ='testsite', 
            # Source Path for Website content 
            # Destination path for Website content 
            [String]$DestinationPath = 'd:\test\testsite\'
        # Import the module that defines custom resources 
        Import-DscResource -Module xWebAdministration 
        Node $NodeName 
            # Install the IIS role 
            WindowsFeature IIS 
                Ensure          = "Present" 
                Name            = "Web-Server" 
            # Install the ASP .NET 4.5 role 
            WindowsFeature AspNet45 
                Ensure          = "Present" 
                Name            = "Web-Asp-Net45" 
            # Stop the default website 
            xWebsite DefaultSite  
                Ensure          = "Present" 
                Name            = "Default Web Site" 
                State           = "Stopped" 
                PhysicalPath    = "C:\inetpub\wwwroot" 
                DependsOn       = "[WindowsFeature]IIS" 
            xWebsite NewWebsite 
                Ensure          = "Present" 
                Name            = $WebSiteName 
                State           = "Started" 
                PhysicalPath    = $DestinationPath 
                BindingInfo     = MSFT_xWebBindingInformation 
                                   Protocol              = "HTTP" 
                                   Port                  = 8080 
                                   #CertificateThumbprint ="71AD93562316F21F74606F1096B85D66289ED60F" 
                                   #CertificateStoreName  = "WebHosting" 
    Sample_xWebsite_NewWebsite -WebSiteName 'testsite' -DestinationPath 'd:\test\testsite\'
    Start-DscConfiguration -Wait -Force -Verbose -Path .\Sample_xWebsite_NewWebsite
    • This topic was modified 1 week, 1 day ago by Profile photo of Marcel Czech Marcel Czech.
    Profile photo of Nitin Gupta
    Nitin Gupta

    This sample configuration in itself won't do everything you need for your scenario. You have to find the set of resources that can do simple tasks like creating website and then bind them together like this sample configuration is doing. For starters:
    You can use either *File* (from PSDesiredStateConfiguration Module) or *xRemoteFile* (from xPsDesiredStateConfiguration module) to copy contents from a location to your target Node.
    To deploy a website, you can use *xWebsite* from xWebAdministration module.
    To start a process you can use *xWindowsProcess* from xPsDesiredStateConfiguration module.
    To configuration SQL server you can use resources from xSQLServer module.

    Here are the links to the module and documentation on github:

    There are tons of DSC resources that starts with 'x' (for experimental) and 'c' (for community). You will find most of them on github. The following query DSC Resources can get you started in exploring some of them.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.