Skip to content

Commit b01876b

Browse files
gaelcolasCopilot
andauthored
Update src/powershell/public/Clear-ZtRequiredModule.ps1
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 03efde0 commit b01876b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/powershell/public/Clear-ZtRequiredModule.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ function Clear-ZtRequiredModule {
1616
Write-Warning -Message 'This command cannot be run when the module is loaded.'
1717
Write-Warning -Message 'Please close all sessions where ZeroTrustAssessment module is loaded, then run the following...'
1818
Write-Warning -Message ('&''{0}''' -f $PSCommandPath)
19-
Set-Clipboard -Value ('&''{0}''' -f $PSCommandPath)
20-
Write-Warning -Message ('(The command has been copied to your clipboard.)')
19+
if ($isWindows -and (Get-Command -Name Set-Clipboard -ErrorAction SilentlyContinue)) {
20+
Set-Clipboard -Value ('&''{0}''' -f $PSCommandPath)
21+
Write-Warning -Message '(The command has been copied to your clipboard.)'
22+
}
2123
return
2224
}
2325
else

0 commit comments

Comments
 (0)