Sharing of thoughts and information is what blogging is all about. This way we can learn from each other. Post A Comment!These postings are provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
Anthony Bartolo Twitter | LinkedIn
Pierre Roman Twitter | LinkedIn
After installing Microsoft Hyper-V Server 2012 R2 or your Windows Server 2012 R2 is on Core version (without GUI enable) you realize that you don’t have much information at login regarding your local virtualization infrastructure.
Normally, when you login to a Hyper-V server you will get a command prompt and a running instance of the Server Configuration tool. For the first time, it’s very handy, but can be combersome afterwards. The reality is that most of the time you will be managing Hyper-V remotely from your own Windows computer. The only reason why you would want to login to a Hyper-V server directly is because something has gone wrong, and requires you to do some troubleshooting directly on the server itself.
When you want to troubleshoot the Hyper-V server, you want to see if your VMs are ok and ensure access to the PowerShell window is enabled so you can use the Hyper-V cmdlets to debug even further. Lets first launch PowerShell.
Step 1: Launching PowerShell from the Command Prompt
If you want a little more than that, and want a summary “state” of your VMs at login, like a PowerShell “Dashboard”, than you can create a PowerShell profile. The following script provided by Ben Armstrong, Microsoft's Hyper-V Program Manager, can help you enable said dashboard.
Step 2: Creating a PowerShell Profile
As an alternate solution, I found simply adding the PowerShell.exe as a second prompt launching as a better solution. In this manner you're not altering the base configuration to Windows but adding to it. There is a potential that an update from Microsoft might break the configuration by "correcting" the key to it's default value.So what I've done on my Hyper-V Server is actually add this key instead.new-itemproperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run\" -PropertyType String -Name PoshStart -Value "Powershell.exe -WindowStyle Maximized" This ensures you get what you need (PowerShell on Startup) without breaking the Windows Base configuration.You can even save a bit of code by removing the "WRITE-HOST" if you enclose your text in Double Quotes like this"Welcome to $env:computername"' ''Current virtual machine status:'get-vm' 'SeanHonorary Scripting GuyWindows PowerShell MVP