<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Powershell Prompt in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63810#M3166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit your Powershell profile file ([my documents]\WindowsPowershell\profile.ps1). If this file does not exist, create it, then add this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function prompt&lt;BR /&gt;{&lt;BR /&gt;$label = "Not Connected"&lt;BR /&gt;$color = "gray"&lt;/P&gt;&lt;P&gt;if ( (Get-Variable | ? { $_.Name -ieq "currentNaController" }) )&lt;BR /&gt;{&lt;BR /&gt;if ( $global:currentNaController )&lt;BR /&gt;{&lt;BR /&gt;$label = $global:currentNaController&lt;BR /&gt;$color = "Green"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write-Host ("[$label]") -ForegroundColor $color -NoNewline&lt;BR /&gt;return (" " + (Get-Location) + "&amp;gt; ");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When not connected, you see this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://community.netapp.com/legacyfs/online/13673_Netapp1.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Connected, you get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://community.netapp.com/legacyfs/online/13674_NetApp2.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought someone might find this handy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 06:41:33 GMT</pubDate>
    <dc:creator>bsti</dc:creator>
    <dc:date>2025-06-05T06:41:33Z</dc:date>
    <item>
      <title>Powershell Prompt</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63810#M3166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit your Powershell profile file ([my documents]\WindowsPowershell\profile.ps1). If this file does not exist, create it, then add this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function prompt&lt;BR /&gt;{&lt;BR /&gt;$label = "Not Connected"&lt;BR /&gt;$color = "gray"&lt;/P&gt;&lt;P&gt;if ( (Get-Variable | ? { $_.Name -ieq "currentNaController" }) )&lt;BR /&gt;{&lt;BR /&gt;if ( $global:currentNaController )&lt;BR /&gt;{&lt;BR /&gt;$label = $global:currentNaController&lt;BR /&gt;$color = "Green"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write-Host ("[$label]") -ForegroundColor $color -NoNewline&lt;BR /&gt;return (" " + (Get-Location) + "&amp;gt; ");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When not connected, you see this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://community.netapp.com/legacyfs/online/13673_Netapp1.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Connected, you get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://community.netapp.com/legacyfs/online/13674_NetApp2.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought someone might find this handy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:41:33 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63810#M3166</guid>
      <dc:creator>bsti</dc:creator>
      <dc:date>2025-06-05T06:41:33Z</dc:date>
    </item>
    <item>
      <title>Powershell Prompt</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63814#M3167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the toolkit alot: cool&lt;/P&gt;&lt;P&gt;Using the toolkit enough to change your default prompt: &lt;EM&gt;priceless&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the great example!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 15:29:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63814#M3167</guid>
      <dc:creator>timothyn</dc:creator>
      <dc:date>2011-11-11T15:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell Prompt</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63818#M3168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found this handy, but I had trouble getting this to work in Powershell 3.0, but I got it working again by excluding the Get-Variable if statement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function prompt&lt;BR /&gt;{&lt;BR /&gt;$label = "Not Connected"&lt;BR /&gt;$color = "gray"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if ( $global:currentNaController )&lt;BR /&gt;{&lt;BR /&gt;$label = $global:currentNaController&lt;BR /&gt;$color = "Green"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write-Host ("[$label]") -ForegroundColor $color -NoNewline&lt;BR /&gt;return (" " + (Get-Location) + "&amp;gt; ");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this will save others some pain &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.netapp.com/5.0.1/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 10:57:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Prompt/m-p/63818#M3168</guid>
      <dc:creator>david_ovenden</dc:creator>
      <dc:date>2013-08-08T10:57:52Z</dc:date>
    </item>
  </channel>
</rss>

