如何解决使用 Powershell 在 Azure 存储中使用 PGP 加密 blob
我正在尝试使用 Powershell(项目需要,但不是我的语言)通过 webjob 加密 Azure blob 存储中的一些文件。
循环有效,我可以列出以下 blob:
def show_figure(f):
'''
Decorator to change fig.show() behavior.
'''
def wrapper():
import matplotlib.pyplot as plt
f() # call the original fig.show(),remove this line if there is no need to run fig.show()
plt.show()
return wrapper
def plot_foobar():
# fancy plotting routing in a package
import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot([1,2],[3,4])
fig.show = show_figure(fig.show) # assign a decorator
return fig
# the user invokes the plotting function and gets back the figure object
fig = plot_foobar()
fig.show()
到目前为止的代码..
DIDE HP_Dana_6cb72486-cb9f-4d03-a3c4-0953fd3e2abc.txt
DIDE HP_Dana_c4f9e193-5498-4289-9aae-d76507c2abd7.txt
DIDE/Prime150620210_703b6bcd-179f-40e6-b30b-167ad38eed08.ddi
DIDE/Prime150620211_715f0db1-fb65-4e64-83ed-2a9690ae7c5f.ddi
DIDE/Prime150620212_ebd833c1-aedf-4681-82fd-c4b09dc8da40.ddi
DIDE/Prime150620213_5d88af9d-7d5d-423b-87d8-f6b8c017e2d4.ddi
DIDE/Prime150620215_7f5eed68-b4a1-4b67-b496-f5a0fa7b1156.ddi
DIDE/Prime220620210_75bc1201-7e34-4fe2-8dd7-270ab03526dc.ddi
DIDE/Prime240620210_c48cc859-ebfc-4b2e-858c-3f5cd5764b1a.ddi
DIDE/Prime240620211_9b0373a8-121a-49b6-80e1-19596b1085da.ddi
DIDE/Prime250620210_2ef48e0e-cfeb-413f-a7ec-332706315ce9.ddi
DIDE/Prime260620210_b147f316-2146-4e17-968a-b161282c5b18.ddi
DIDE/Prime290620210_8a978889-643f-47a7-9fc4-b6c58c6fb318.ddi
错误:
$context = New-AzureStorageContext -ConnectionString 'DefaultEndpointsProtocol=https;AccountName=stftoscoreyrot001;AccountKey=iSTp3g92fJcmV+FRM4VBxfGsriA9NSIJ2hHpYTQ1idy8mSCfMaqdpb7NdboethfsQzKaT1kcGks9J8wqgOjzrA==;EndpointSuffix=core.windows.net'
$containerName = 'uploadebs'
$Progresspreference = "SilentlyContinue"
$Progresspreference
$blobs = Get-AzureStorageBlob -Container $containerName -Context $context
$publicKey = $env:Dide_Encryption_Key
foreach ($blob in $blobs) {
if ($blob.Name -match '^DIDE*') {
$f = $blob.Name
start-process -FilePath .\GnuPG\bin\gpg.exe "--batch","--quiet","--yes" "-o","d:\home\DIDE\*.gpg","-e","-r",$privateKey,$blob.Name
}
}
欢迎任何帮助!
解决方法
在作为参数传递给 "--yes"
的数组中,"-o"
和 Start-Process
之间缺少逗号。如果没有逗号,这将被解释为两个数组而不是一个。
只有第一个数组绑定到参数 -ArgumentList
,第二个数组无法绑定并抛出异常。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。