pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


powershell start IIS
Posted by Anonymous on Tue 28th Oct 2025 22:48
raw | new post

  1. # powershell start IIS
  2. $SiteName   = "DefaultWebSite"
  3. $TargetRoot = "N:\wwwroot"
  4.  
  5. # Install minimal IIS features
  6. Write-Host "Installing minimal IIS features..." -ForegroundColor Cyan
  7. Install-WindowsFeature Web-Server, Web-Static-Content, Web-Default-Doc, Web-Http-Errors -IncludeManagementTools
  8.  
  9. # Configure IIS site root
  10. Import-Module WebAdministration
  11. Set-ItemProperty "IIS:\Sites\$SiteName" -Name physicalPath -Value $TargetRoot
  12.  
  13. # Restart IIS
  14. iisreset

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at