Improved the output

This commit is contained in:
Markus Fleschutz 2021-04-07 13:55:58 +02:00
parent ee7fd35b75
commit 1841a8a931

View File

@ -7,13 +7,12 @@
#> #>
function ShowProfile { param([int]$Level, [string]$Name, [string]$Filename) function ShowProfile { param([int]$Level, [string]$Name, [string]$Filename)
write-output "$($Level). '$($Name)'" write-output "Level: $Level"
write-output "Name: $Name"
if (test-path "$Filename") { if (test-path "$Filename") {
write-output " at $($Filename) containing:" write-output "File: $Filename"
$Content = get-content $Filename
write-output "$Content"
} else { } else {
write-output " at $Filename (file non-existent)" write-output "File: $Filename (file missing)"
} }
write-output "" write-output ""
} }
@ -21,7 +20,7 @@ function ShowProfile { param([int]$Level, [string]$Name, [string]$Filename)
try { try {
write-output "" write-output ""
write-output "PowerShell Profiles" write-output "PowerShell Profiles"
write-output "-------------------" write-output "==================="
ShowProfile 1 "AllUsersAllHosts" $PROFILE.AllUsersAllHosts ShowProfile 1 "AllUsersAllHosts" $PROFILE.AllUsersAllHosts
ShowProfile 2 "AllUsersCurrentHost" $PROFILE.AllUsersCurrentHost ShowProfile 2 "AllUsersCurrentHost" $PROFILE.AllUsersCurrentHost
ShowProfile 3 "CurrentUserAllHosts" $PROFILE.CurrentUserAllHosts ShowProfile 3 "CurrentUserAllHosts" $PROFILE.CurrentUserAllHosts