Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created November 21, 2022 10:03
Show Gist options
  • Save IISResetMe/7f742b817e72aaaca02472a76018fe6d to your computer and use it in GitHub Desktop.
Save IISResetMe/7f742b817e72aaaca02472a76018fe6d to your computer and use it in GitHub Desktop.
function ConvertFrom-WildcardPattern {
param(
[Parameter(Mandatory, ValueFromPipeline)]
[WildcardPattern]$InputObject
)
begin {
$pctrProp = [WildcardPattern].
GetMember('PatternConvertedToRegex', [Reflection.BindingFlags]'NonPublic, Instance')
}
process {
return $pctrProp.GetMethod.Invoke($InputObject, @())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment