Powershell使用完全UNC从共享网络文件夹导入Clixml-系统找不到指定的文件



我正试图在SQL代理作业中运行powershell脚本。我一直收到错误:导入Clixml:系统找不到指定的文件。在\Data\Powershell\Collbra\Dev\test.ps1:95 char:21+。。。redential=Import Clixml-路径文件系统::\Data\Powershell…+~~~~~~CategoryInfo:NotSpecified:(:([Import Clixml],Cryptographic Exception+FullyQualifiedErrorId:系统。安全密码学。CryptographicException,Microsoft。PowerShell。命令。ImportClixmlCommand

$Credential = Import-Clixml -Path 
Filesystem::\energydataappsBISharedServicesPowershellCollibraDevcredentials.xml
$username = $Credential.GetNetworkCredential().UserName
$password = $Credential.GetNetworkCredential().Password
$credPair = "$($username):$($password)"
$encodedCredentials =       [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credPair))
$H = @{ Authorization = "Basic $encodedCredentials" }

我试着绘制了一个新的驱动器并设置了一个位置。同样的结果。这把我逼疯了!

谢谢你的帮助。

在至少没有SSIS的基本Powershell中,它的开头只有一个斜杠:

Import-Clixml -Path FileSystem::pathtofile.txt

最新更新