powershell - How can I enable “URL Rewrite” Module in IIS 8.5 in Server 2012 via the command line at first boot -


similar question: how can enable "url rewrite" module in iis 8.5 in server 2012? via command line.

i want create script use in userdata field in aws (scripts run on first boot configure server) , wondering on best way install url rewrite 2.0 via command line or other web platform installer items.

thanks

i use chocolatey this. in fact, have set of functions tend use make easier. save script somewhere , call userdata script:

<# .description path environment variables machine, user, , process locations, , update current powershell process's path variable contain values each of them. call after updating machine or user path value (which may happen automatically during installing software) don't have launch new powershell process them. #> function update-environmentpath {     [cmdletbinding()] param()     $oldpath = $env:path     $machinepath = [environment]::getenvironmentvariable("path", "machine") -split ";"     $userpath    = [environment]::getenvironmentvariable("path", "user")    -split ";"     $processpath = [environment]::getenvironmentvariable("path", "process") -split ";"     $env:path = ($machinepath + $userpath + $processpath | select-object -unique) -join ";"     write-eventlogwrapper -message "updated path environment variable`r`n`r`nnew value: $($env:path -replace ';', "`r`n")`r`n`r`nold value: $($oldpath -replace ';', "`r`n")" }  # install chocolatey itself: invoke-webrequest https://chocolatey.org/install.ps1 -usebasicparsing | invoke-expression # note: chocolatey changes system %path%, have latest update here: update-environmentpath # configure chocolatey not require confirmation when installing packages: choco.exe feature enable --name=allowglobalconfirmation --yes  # install package care choco.exe install urlrewrite 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -