Skip to content

Commit e6c98e5

Browse files
riddhinilawarRiddhi Nilawar
andauthored
Added return type boolean log for Remove Flow Log Command (#26958)
Co-authored-by: Riddhi Nilawar <[email protected]>
1 parent 705bbe3 commit e6c98e5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Updated `Remove-AzNetworkWatcherFlowLog` command to return boolean value
2223
* Updated vnv and ipam cmdlets
2324
* Allowed TA interval to be set as 0 incase TA is disabled
2425
* Onboarded Azure Virtual Network Manager Cmdlets for IpamPool

src/Network/Network/NetworkWatcher/FlowLog/RemoveAzNetworkWatcherFlowLogCommand.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,20 @@ public override void Execute()
146146
this.Name,
147147
() =>
148148
{
149-
this.FlowLogs.Delete(this.ResourceGroupName, this.NetworkWatcherName, this.Name);
150-
151-
if (PassThru)
149+
try
152150
{
151+
this.FlowLogs.Delete(this.ResourceGroupName, this.NetworkWatcherName, this.Name);
153152
WriteObject(true);
154153
}
154+
catch (Exception ex)
155+
{
156+
WriteObject(false);
157+
throw ex;
158+
}
159+
if (PassThru)
160+
{
161+
WriteObject("PassThru: " + true);
162+
}
155163
});
156164
}
157165
}

0 commit comments

Comments
 (0)