mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-17 16:11:22 +02:00
Added list-profile.ps1
This commit is contained in:
23
Scripts/list-profile.ps1
Executable file
23
Scripts/list-profile.ps1
Executable file
@ -0,0 +1,23 @@
|
||||
#!/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 "Missing profile file at: $PathToProfile"
|
||||
}
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#!/bin/powershell
|
||||
<#
|
||||
.SYNTAX ./list-scripts.ps1
|
||||
.DESCRIPTION lists the PowerShell scripts in this repository
|
||||
.DESCRIPTION lists all PowerShell scripts in this repository (sorted alphabetically)
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
Reference in New Issue
Block a user