Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $StorageAccount = Get-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName
- $blob = Get-AzureStorageBlob -Context $StorageAccount.Context -Container "Database name" -Blob "CreateNewPartition.xmla"
- $file = $blob.ICloudBlob.DownloadText()
- Invoke-ASCmd `
- -Database $AnalysisServiceDatabase `
- -InputFile $file `
- -server $AnalysisServiceServer
- $memStream = New-Object System.IO.MemoryStream
- $blob.ICloudBlob.DownloadToStream($memStream)
- $readStream = New-Object System.IO.StreamReader($memStream, [System.Text.Encoding]::Unicode)
- $memStream.Position = 0
- $file = ($readStream.ReadToEnd() -replace "`0",'' | ConvertFrom-Json)
- $byteArray = New-Object Byte[] $blob.Length
- $file = $blob.ICloudBlob.DownloadToByteArray($byteArray, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement