SHARE
TWEET

Untitled

a guest Jun 13th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $StorageAccount = Get-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName
  2.  
  3. $blob = Get-AzureStorageBlob -Context $StorageAccount.Context -Container "Database name" -Blob "CreateNewPartition.xmla"
  4.  
  5. $file = $blob.ICloudBlob.DownloadText()
  6. Invoke-ASCmd `
  7.     -Database $AnalysisServiceDatabase `
  8.     -InputFile $file `
  9.     -server $AnalysisServiceServer
  10.      
  11. $memStream = New-Object System.IO.MemoryStream
  12. $blob.ICloudBlob.DownloadToStream($memStream)
  13. $readStream = New-Object System.IO.StreamReader($memStream, [System.Text.Encoding]::Unicode)
  14. $memStream.Position = 0
  15. $file = ($readStream.ReadToEnd() -replace "`0",'' | ConvertFrom-Json)
  16.      
  17. $byteArray = New-Object Byte[] $blob.Length
  18. $file = $blob.ICloudBlob.DownloadToByteArray($byteArray, 0)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top