2015-11-13 65 views
0
$physicalPath = 'C:\Projects\Foo' 

& cmd /c C:\windows\System32\inetsrv\appcmd set vdir 'Default Web Site/' -physicalPath:$physicalPath 

Error: "Failed to process input: The Parameter 'C:\Projects\Foo' must begin with a \ or -"無法處理輸入

缺少什麼我在這裏?

回答

1
$physicalPath = 'C:\Projects\Foo' 
$defaultsite = 'Default Web Site/' 

start-process cmd.exe -ArgumentList "/c C:\windows\System32\inetsrv\appcmd set vdir $defaultsite /physicalPath:$physicalPath" 

我不知道你在哪裏,你是不是真的使用命令來獲取參數集讓你physicalpath參數,這可能會幫助你。