I have the following script:
$Logdir = $args[0]
$Description = $args[1]
$Domain = $args[2]
New-Item IIS:Sites$Description -Bindings (
@{Protocol="http"; BindingInformation="*:80:$Domain"},
@{Protocol="http"; BindingInformation="*:80:www.$Domain"}
) -PhysicalPath "$LogDirhttp"
I executed it as:
create.ps1 "C:\inetpubyusufozturk.info" "www.yusufozturk.info" "yusufozturk.info”
I got following error:-
New-Item : A parameter cannot be found that matches parameter name 'Bindings'. At C:\es\develop\ShareAspace\create.ps1:4 char:32 + New-Item IIS:Sites$Description -Bindings (@{Protocol="http";BindingIn ... + ~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-Item], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.NewItemCommand
I'm new in PS scripting. I don't know what is wrong? Also please inform me how to delete a website by power shell?