Skip to content

Commit 4c24f71

Browse files
SteveL-MSFTiSazonov
authored andcommitted
Expose all cmdlets from PSDiagnostics if logman.exe is available (#8366)
1 parent ddd69c8 commit 4c24f71

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,12 @@ namespace Microsoft.PowerShell.Diagnostics
437437
}
438438
"@
439439

440-
if ($psedition -eq 'Core')
441-
{
442-
# Currently we only support these cmdlets as logman.exe is not working on Nano/Lot system.
443-
Export-ModuleMember Enable-PSTrace, Disable-PSTrace, Get-LogProperties, Set-LogProperties
444-
}
445-
else
446-
{
447-
Export-ModuleMember Start-Trace, Stop-Trace, Enable-WSManTrace, Disable-WSManTrace, Enable-PSTrace, Disable-PSTrace, Enable-PSWSManCombinedTrace, Disable-PSWSManCombinedTrace, Get-LogProperties, Set-LogProperties
448-
}
440+
if (Get-Command logman.exe -Type Application -ErrorAction SilentlyContinue)
441+
{
442+
Export-ModuleMember Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace, Enable-PSWSManCombinedTrace, Enable-WSManTrace, Get-LogProperties, Set-LogProperties, Start-Trace, Stop-Trace
443+
}
444+
else
445+
{
446+
# Currently we only support these cmdlets as logman.exe is not available on systems like Nano and IoT
447+
Export-ModuleMember Disable-PSTrace, Enable-PSTrace, Get-LogProperties, Set-LogProperties
448+
}

0 commit comments

Comments
 (0)