Added list-profile.ps1

This commit is contained in:
Markus Fleschutz
2021-02-24 07:35:59 +01:00
parent d0de5af787
commit 4d8e3d6bbe
4 changed files with 35 additions and 7 deletions

23
Scripts/list-profile.ps1 Executable file
View 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
}

View File

@ -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
#>