mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-05 10:02:21 +01:00
24 lines
560 B
PowerShell
Executable File
24 lines
560 B
PowerShell
Executable File
#!/bin/powershell
|
|
<#
|
|
.SYNTAX ./list-profile.ps1
|
|
.DESCRIPTION lists your PowerShell profile file
|
|
.LINK https://github.com/fleschutz/PowerShell
|
|
.NOTES Author: Markus Fleschutz / License: CC0
|
|
#>
|
|
|
|
try {
|
|
$PathToProfile = "$PROFILE"
|
|
|
|
if (test-path $PathToProfile) {
|
|
$Content = get-content $PathToProfile
|
|
write-output "Profile file at: $PathToProfile"
|
|
write-output "$Content"
|
|
} else {
|
|
write-warning "No profile file at: $PathToProfile"
|
|
}
|
|
exit 0
|
|
} catch {
|
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
exit 1
|
|
}
|