Configure-IIS
use powershell cmdlets to remote configure IIS configuration settings
How to use
-
set variable in config.ini
user={user_name} password={user_password} server={server} command={command} action={action} # 1/2/3/4 reference below action table param={param} #escape strings in JSON like '{"\"appPool"\":"\"michaeltestpool"\"}'
-
call test.bat execute a PowerShell script
or running PowerShell.exe inside command prompt
powershell.exe -noexit .\Remote-IIS.ps1 -user {user} -password {password} -server {server} -command {command} -action {action} -param {param}
Show all functions
powershell.exe -noexit .\allFunction.ps1
Action
Action/Command | AppPool | Site | Application |
0 | Remove | ||
1 | Add | ||
2 | Set | ||
3 | List | ||
4 | Web Bind | VirtualDirectory |
Test
Local
cd localtest
powershell -ExecutionPolicy unrestricted -command "& { . .\application.ps1; Create-New-Application 'Default Web Site' 'testapp' 'D:\Demo_Web\Sample' 'demoPool' '1' }"
Command
..Command Table
Sample
..Sample