Question Status

Verified
Mohamed Meeran Hussain asked a question on 14 May 2014 9:21 PM

Hi Guys,

Is it possible to deploy a set reports of particular model. I am not seeing any parameters in AX power shell using help to proceed the deployment.

So is it possible to do above.

 

Thanks,

Reply
Verified Answer
Martin Dráb responded on 14 May 2014 10:25 PM

Shells are mainly about combining multiple commands together to get what you need. In this case, get a list of reports from Get-AXModel and pass it to Publish-AXReport. This is how to get the list:

Get-AXModel -Model MyModel -Details | select -exp Elements | ? ElementType -eq SSRSReport | select Name

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
Mohamed Meeran Hussain responded on 15 May 2014 9:23 PM

HI Martin,

I have tried the above until "Get-AXModel -Model MyModel -Details | select -exp Elements " I can get the a list of values. Also I am able to store it in a variable and then I can view it.

But when I use the rest of the part "| ? ElementType -eq SSRSReport | select Name" I am getting some error. I googled and tried some ways, but no gain.

Requesting you guidance on this .

Thanks.

Reply
Martin Dráb responded on 15 May 2014 11:05 PM

Ah, sorry, you're using Powershell 2.0, aren't you? Try the following instead:

| ? {$_.ElementType -eq 'SSRSReport' } | select Name

The shorter and more readable syntax was introduced in Powershell 3.0.

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
Mohamed Meeran Hussain responded on 19 May 2014 2:45 AM

Hi Martin,

It worked. But when I tried to get the meaning of the syntax I am not able to get it online.

Could please provide some links which has the above syntax along with their meaning. It wil be useful me in future.

Thanks,

Mohamed.

Reply
Martin Dráb responded on 19 May 2014 2:59 AM

Check out links below for details about the individual cmdlets. Nevertheless you may want to learn some Powershell basics first - just use your favorite search engine, you'll surely find many resources.

Select-Object

Where-Object

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
Mohamed Meeran Hussain responded on 20 May 2014 5:52 AM

Thanks Martin.

Reply
Verified Answer
Martin Dráb responded on 14 May 2014 10:25 PM

Shells are mainly about combining multiple commands together to get what you need. In this case, get a list of reports from Get-AXModel and pass it to Publish-AXReport. This is how to get the list:

Get-AXModel -Model MyModel -Details | select -exp Elements | ? ElementType -eq SSRSReport | select Name

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply