通过ARM部署VM时,将执行所需的状态配置。 有两个脚本资源需要将SMB驱动器映射到当前用户。 因此,两个脚本资源都需要其他ps凭证。
但是我在执行时遇到以下错误:
Script MapVirtualDriveIcsUser
{
DependsOn = "[User]IcsUserAccount"
GetScript = { return $false }
TestScript = { return !(Test-Path Z:) }
SetScript = {
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\$($fileShareLocation)" -Credential $storageAccountCredentials -Persist -Scope Global
}
PsDscRunAsCredential = $icsCredentials
}
Script MapVirtualDrivePartnerUser
{
DependsOn = "[User]PartnerUserAccount"
GetScript = { return $false }
TestScript = { return !(Test-Path Z:) }
SetScript = {
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\$($fileShareLocation)" -Credential $storageAccountCredentials -Persist -Scope Global
}
PsDscRunAsCredential = $vmPartnerCredentials
}
Following are the first few: The resources ('[Script]MapVirtualDriveIcsUser' and '[Script]MapVirtualDrivePartnerUser') have conflicting values of the following properties: 'PsDscRunAsCredential'.
如何解决这个问题?
答案 0 :(得分:0)
没有"清洁"解决这个问题的方法。你应该提出一个bug,因为它确实是一个bug。顺便说一下,我想我之前遇到过这个问题。
最好的办法是将这些资源合并到一个脚本资源中并传入凭据或在这些步骤中使用相同的凭据。
https://powershell.org/forums/topic/salted-psdscrunascredentials-considered-conflicting-values/