From 85710811e2c5b3192444ed11f05314617b6dc58a Mon Sep 17 00:00:00 2001 From: Blake Drumm Date: Wed, 4 Aug 2021 09:54:48 -0400 Subject: [PATCH] Update Get-SCOMNotificationSubscriptionDetails.ps1 --- .../Get-SCOMNotificationSubscriptionDetails.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Powershell/Get-SCOMNotificationSubscriptionDetails.ps1 b/Powershell/Get-SCOMNotificationSubscriptionDetails.ps1 index d84eeee..cc521ed 100644 --- a/Powershell/Get-SCOMNotificationSubscriptionDetails.ps1 +++ b/Powershell/Get-SCOMNotificationSubscriptionDetails.ps1 @@ -3,7 +3,7 @@ function Get-SCOMNotificationSubscriptionDetails param ( [Parameter(Mandatory = $false)] - [string]$Output + [string]$OutputFile ) #Originally found here: https://blog.topqore.com/export-scom-subscriptions-using-powershell/ # Located here: https://github.com/blakedrumm/SCOM-Scripts-and-SQL/blob/master/Powershell/Get-SCOMNotificationSubscriptionDetails.ps1 @@ -232,6 +232,13 @@ function Get-SCOMNotificationSubscriptionDetails $finalstring += $MainObject | Out-String } - $finalstring + if($OutputFile) + { + $finalstring | Out-File $OutputFile + } + else + { + $finalstring + } } Get-SCOMNotificationSubscriptionDetails