Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
上传powershell后获取Azure存储blob url_Powershell_Azure_Azure Storage_Azure Storage Blobs - Fatal编程技术网

上传powershell后获取Azure存储blob url

上传powershell后获取Azure存储blob url,powershell,azure,azure-storage,azure-storage-blobs,Powershell,Azure,Azure Storage,Azure Storage Blobs,如何获取我刚刚使用powershell上载的blob的url。我的代码当前为 $storagekey=Get-AzureStorageKey -StorageAccountName appstorageacc $ctx=New-AzureStorageContext -StorageAccountName appstorageacc - StorageAccountKey $storagekey.Primary Set-AzureStorageBlobContent -File C:\Pa

如何获取我刚刚使用powershell上载的blob的url。我的代码当前为

$storagekey=Get-AzureStorageKey -StorageAccountName appstorageacc
$ctx=New-AzureStorageContext -StorageAccountName 
appstorageacc -   StorageAccountKey $storagekey.Primary
Set-AzureStorageBlobContent -File C:\Package\StarterSite.zip 
-Container   clouddata -Context $ctx -Force

Blob已成功上载,但如何才能获取其url?

使用cmdlet检索Blob信息并选择
绝对URI

(Get-AzureStorageBlob -blob 'StarterSite.zip' -Container 'clouddata ').ICloudBlob.uri.AbsoluteUri
另一个选项:只需捕获
Set-AzureStorageBlobContent
$result=Set AzureStorageBlobContent-文件C:\Package\StarterSite.zip
$blobUri=$result.ICloudBlob.Uri.AbsoluteUri
调用
设置AzureStorageBlobContent
后,无需调用
获取AzureStorageBlob

Set-AzureStorageBlobContent
返回与
Get-AzureStorageBlob
返回的对象类型相同的对象类型

更多细节 和的输出类型均为
AzureStorageBlob


哪个具有
Uri
属性

您是如何找到它的?查看Get-AzureStorageBlob返回的对象/属性,我没有发现有更多可用信息。@Orangutech在文档底部()您可以看到cmdlet的输出