4

Does anyone know how to hide output from command Select-AzureRmSubscription inside azure workbook which runs as powershell workflow

Thanks

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
Rafal
  • 217
  • 1
  • 3
  • 9

2 Answers2

6

You can use Out-Null. Works for any PowerShell cmdlet.

Select-AzureRmSubscription | Out-null

The Out-Null cmdlet sends its output to NULL, in effect, removing it from the pipeline and preventing the output to be displayed at the screen.

https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/out-null

Bruno Faria
  • 5,219
  • 3
  • 24
  • 27
  • I was looking for Connect-AzureAD powershell command without output. Very helpful @Bruno Faria – Arjun Nov 04 '20 at 19:10
0

Select-AzSubscription -SubscriptionId $s.Id | Out-Null + ~~~~~~~~ Cannot call the 'Out-Null' command. Other commands from this module have been packaged as workflow activities, but this command was specifically excluded. This is likely because the command requires an interactive Windows PowerShell session, or has behavior not suited for workflows. To run this command anyway, place it within an inline-script (InlineScript { Out-Null }) where it will be invoked in isolation