【发布时间】:2021-10-30 08:09:51
【问题描述】:
我开发了以下 PowerShell 脚本,用于在 Azure Blob 存储容器中创建文件夹。
Param(
[Parameter(Mandatory = $True)]
[string]
$resourceGroupName,
[Parameter(Mandatory = $True)]
[string]
$storageAccountName
)
$storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -AccountName $storageAccountName
$ctx = $storageAccount.Context
$dirs = @('ABC', 'XYZ', 'ABC123', 'XYZ123')
$subdirs = @('Archive', 'Logs')
Foreach ($d in $dirs) {
ForEach ($s in $subdirs) {
New-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $d/$s -Directory
}
}
我想将.xml 文件添加/上传到 Azure Blob 存储容器的特定文件夹路径 (ABC123/Logs)。
【问题讨论】:
-
请编辑您的问题并提供有关您在脚本中遇到的问题的详细信息。
标签: azure powershell azure-blob-storage