I am writing a PowerShell 3.0 installer for our web applications and web services, and when I try to set the credentials of the physical path, I try to work.
My code is as follows:
$filter="/system.applicationHost/sites/site[@name='{0}' and @id='1']/application[@path='/{1}']/VirtualDirectory[@path='/']" -f $script:WebSiteName,$appName
Set-WebConfiguration $filter -Value @{userName="$physicalPathCredentialUserID";password="$physicalPathCredentialPassword"}
When I execute, I get an error in PowerShell: "This configuration section cannot be used along this path. This occurs when the section is locked at the parent level." I tried PSPath tags and locations that work when authentication sections are locked, but they don't seem to have any effect. I thought that perhaps the -Force option would work, but although no error was selected, the credentials of the physical path did not seem to be accepted.
-Force , PowerShell , , , . , "", :/configuration/system.applicationHost/sites/application/virtualDirectory
, . PowerShell WebAdministration . , , , , IIS. Set-WebConfiguration , , Set-WebConfigurationProperty. , , ?
. , , -, "- ".
2014 PowerShell 3.0? PSPath ?
, :
$filter="/system.applicationHost/sites/site[@name='{0}' and @id='1']/application[@path='/{1}']/VirtualDirectory[@path='/']" -f $script:WebSiteName,$appName
Set-WebConfiguration $filter machine/webroot/appHost -metadata overrideMode -value Allow
, .
virtualDirectoryDefaults.userName virtualDirectoryDefaults.password, , , , IISReset , applicationHost.config. , , .
, . -, -.