Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Pass varibales from Ps1 script to xmla file

$
0
0

I have power shall script  that runs the xmal script  I need to pass the $Cube and $DatabaseId  variables to xmla file to run on the cube. I can pass the $(DatabaseID) in .bat file. can I do it in powershell?

$path = (Get-Location)
$serverName = $args[0]
$cube = "MODPIMConsumer"
$DatabaseID ="Consumer Subscription Datamart"
Invoke-ASCmd -Server "$serverName" -InputFile "$path\scripts\ClearCache.mdx"

xmla file

<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
  <ClearCache>
    <Object>
      <DatabaseID>$(DatabaseID)</DatabaseID>   
    </Object>
  </ClearCache>
</Batch>


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>