I use the Powershell Tookit a LOT, to the point now where I do most of my controller management via Powershell. One issue I have doing this though is sometimes I'm not sure what controller I'm connected to. I wrote the following code blurb to help me always know what controller I'm connected to:
Edit your Powershell profile file ([my documents]\WindowsPowershell\profile.ps1). If this file does not exist, create it, then add this code:
function prompt
{
$label = "Not Connected"
$color = "gray"
if ( (Get-Variable | ? { $_.Name -ieq "currentNaController" }) )
{
if ( $global:currentNaController )
{
$label = $global:currentNaController
$color = "Green"
}
}
Write-Host ("[$label]") -ForegroundColor $color -NoNewline
return (" " + (Get-Location) + "> ");
}
When not connected, you see this:
When Connected, you get this:
I thought someone might find this handy.