ok, got it and i have moved further in to the script, but this one keeps throwing challenges. I cannot filter the output.
so, i am running following code and getting the output as:
code: Get-AzureRmAlertRule -ResourceGroup $ResourceGroup | select -ExpandProperty ‘Name’
Output:
Name : int-en.ca.pods.com.hi.zone-AvailTest-AlertRule
June 12th 2018 17:41:57
Info
Properties : Microsoft.Azure.Management.Insights.Models.AlertRuleResource
June 12th 2018 17:41:57
Info
Tags : {[hidden-link:, Resource], [hidden-link:/subscriptions/ca1eacdc-c8
June 12th 2018 17:41:57
Info
2e-48b0-81ae-43bf2280e9e3/resourceGroups/pods-int-rg/providers/mic
June 12th 2018 17:41:57
Info
rosoft.insights/webtests/pods-int-rg-single.azurewebsites.net-Avai
June 12th 2018 17:41:57
Info
lTest, Resource], [hidden-link:/subscriptions/ca1eacdc-c82e-48b0-8
June 12th 2018 17:41:57
Info
1ae-43bf2280e9e3/resourceGroups/pods-int-rg/providers/Microsoft.In
June 12th 2018 17:41:57
Info
sights/components/pods-int-rg-ai, Resource]}
June 12th 2018 17:41:57
Info
Id : /subscriptions/ca1eacdc-c82e-48b0-81ae-43bf2280e9e3/resourceGroups
June 12th 2018 17:41:57
Info
/pods-int-rg/providers/microsoft.insights/alertrules/pods-int-rg-s
June 12th 2018 17:41:57
Info
ingle.azurewebsites.net-AvailTest-AlertRule
June 12th 2018 17:41:57
Info
Location : East US
As you can see the first property in the output itself is ‘Name’, however when i try to filter using the pipe and select commands in PS it simply throws following error.
select : Property “Name” cannot be found.
June 12th 2018 17:50:44
Error
At C:\Octopus\Work\20180612122040-5355-666\Script.ps1:4 char:54
June 12th 2018 17:50:44
Error
June 12th 2018 17:50:44
Error
+ CategoryInfo : InvalidArgument: (Microsoft.Azure…rtRuleNoDeta
June 12th 2018 17:50:44
Error
ils:PSObject) [Select-Object], PSArgumentException
June 12th 2018 17:50:44
Error
+ FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Comm
June 12th 2018 17:50:44
Error
ands.SelectObjectCommand
Since i am quite new in to Octopus i cannot figure whether filtering is allowed within script or not, assuming that it’s powershell cmdlets, it should.
Thank You.