How to create an IIS application pool and web site on Windows 10 with PowerShell and Visual Studio Code

Tasks to create an IIS application pool and web site on Windows 10 with PowerShell and Visual Studio Code:

  • Install the Visual Studio Code plugin PowerShell 0.6.2
  • Create a file iis.configuration.ps1 in Visual Studio Code:

    # Note: When run with the Visual Studio Code PowerShell debugger, make sure you use the "x64" debugger,
    #       else you will get an error: New-WebAppPool : Cannot retrieve the dynamic parameters for the cmdlet.

    Import-Module WebAdministration

    # Create application pools
    New-WebAppPool -Name "myapp.localhost" -Force

    # Create websites
    New-Website -Name "myapp.localhost" -Port 80 -HostHeader "myapp.localhost" -ApplicationPool "myapp.localhost" -PhysicalPath "c:\projects\myapp\web" -Force

        • Create a launch.json in the same folder as the iis.configuration.ps1:

          {
              "version": "0.2.0",
               "configurations": [
                  {
                      "name": "PowerShell",
                      "type": "PowerShell",
                      "request": "launch",
                      "program": "${workspaceRoot}/iis.configuration.ps1",
                      "args": [],
                      "cwd": "${workspaceRoot}/iis.configuration.ps1"
                  },
                   {
                      "name": "PowerShell x86",
                      "type": "PowerShell x86",
                      "request": "launch",
                      "program": "${workspaceRoot}/iis.configuration.ps1",
                      "args": [],
                      "cwd": "${workspaceRoot}/iis.configuration.ps1"
                  }
              ]
          }

          Now you can debug / run the iis.configuration.ps1 file, by hitting F5, make sure you selected “PowerShell” and not “PowerShell x86” on the debug tab:

          image

          No audio over HDMI on Windows 10 with Intel® HD Graphics 4600 fixed by disabling Hyper-V

          I have spend literarily days figuring out this problem. When I fresh install Windows 10 on my Shuttle DS81 I get audio over HDMI when connecting my LG TV to it, then something changes on my system and I got no audio over HDMI.

           

          The fix

          Turns out that disabling Hyper-V fixes the problem.

           

          I think installing Microsoft Visual Studio 2015 enabled Hyper-V but I’m not sure.

          On this device audio over HDMI is more important then Hyper-V, but I still like Microsoft to fix this problem. This problem exists since a technical preview somewhere begin 2015 and even exist in the current release build of Windows 10.

           

          The weird thing is, that every things seems to work fine, the green bars are showing, just no sound over HDMI:

           

          image