1
I need to execute the following command in PowerShell:
%windir%\system32\inetsrv\appcmd add site /in < c:\mywebsite.xml
I am trying to do it like this:
$appCmd = "$Env:SystemRoot\system32\inetsrv\appcmd.exe"
[String] $targetFilePath = $restoreFromDirectory + "config.xml"
$AllArgs = @('add', 'site', '/in')
& $appCmd $AllArgs | Get-Content $targetFilePath
But this is apperantly wrong since it gives me an error:
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
Please assist on what is the correct alternative to the above mentioned script in PowerShell.