Renamed to list-profiles.ps1

This commit is contained in:
Markus Fleschutz
2021-02-24 19:03:31 +01:00
parent f0e080c867
commit daf53ac0c4
4 changed files with 18 additions and 25 deletions

View File

@ -1,23 +0,0 @@
#!/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
}

16
Scripts/list-profiles.ps1 Executable file
View File

@ -0,0 +1,16 @@
#!/bin/powershell
<#
.SYNTAX ./list-profiles.ps1
.DESCRIPTION lists your PowerShell profiles
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$PROFILE | select-object *
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}