33 lines
839 B
PowerShell
33 lines
839 B
PowerShell
function Get-EnvironmentUserPrefix {
|
|
<#
|
|
|
|
.SYNOPSIS
|
|
Wrapper for Get-AppSetting for Environment.UserPrefix
|
|
|
|
.PARAMETER ComputerName
|
|
[string] The remote computer to connect to. Defaults to localhost.
|
|
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([string])]
|
|
param (
|
|
[Parameter(Mandatory = $false)]
|
|
[string]$ComputerName
|
|
)
|
|
|
|
$logLead = (Get-LogLeadName)
|
|
|
|
if ([string]::IsNullOrWhiteSpace($ComputerName)) {
|
|
Write-Warning "$logLead : ComputerName is null or whitespace, assigning 'localhost' to ComputerName"
|
|
$ComputerName = 'localhost'
|
|
}
|
|
|
|
$params = @{
|
|
Key = "Environment.UserPrefix"
|
|
ComputerName = $ComputerName
|
|
}
|
|
|
|
$appSetting = Get-AppSetting @params
|
|
Write-Verbose "$logLead : ComputerName: [$ComputerName] App Setting value: [$appSetting]"
|
|
return $appSetting
|
|
} |