MicrosoftDocs / PowerShell-Docs

The official PowerShell documentation sources
https://learn.microsoft.com/powershell
Creative Commons Attribution 4.0 International
1.93k stars 1.55k forks source link

`Get-EventSubscriber` and `Unregister-Event` should have examples using `-Force` #11199

Closed SteveL-MSFT closed 2 weeks ago

SteveL-MSFT commented 2 weeks ago

Prerequisites

Links

Summary

Some events require use of -Force as they are intentionally hidden

Details

No response

Suggested Fix

Add examples of using -Force to both docs

sdwheeler commented 2 weeks ago

Examples from Jim

Register-EngineEvent -SourceIdentifier PowerShell.Exiting -SupportEvent -Action {
    Get-History | Export-Clixml d:\temp\history.clixml
}
get-eventsubscriber
get-eventsubscriber -force