Windows 10 running previous PowerShell scripts is crashing

OK so I put 10 on my computer because it is pretty and now I may need to go back to 8.1 :-(

The first script I ran with 10 on my PC which searches for a virtual machine by a keyword failed.

The error is below.

Enabling PS remoting on all the servers we have is not even remotely possible.

I was running 4.5 and the early release of 5.0 on my laptop and desktop under 8.1 and it worked fine .

Is there a way to get the compatible modules it ask for?

Thanks

Get-VM : The Hyper-V module used in this Windows PowerShell session cannot be used for remote management of the server 'MS01AHV53PF04'. Load 
a compatible version of the Hyper-V module, or use Powershell remoting to connect directly to the remote server. For more information, see 
http://go.microsoft.com/fwlink/p/?LinkID=532650.
At C:\Users\9201401145\Google Drive\Scripts\PowerShell\LOOK FOR WHICH SERVER HAS A VIRTUAL MACHINE BY KEYWORD.PS1:29 char:1
+ Get-VM -ComputerName $server |Where-Object {$_.Name -like $lookfor}|S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-VM], VirtualizationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.HyperV.PowerShell.Commands.GetVM
September 11th, 2015 7:52am

Works fine on my Windows 10 system.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 8:02am

It worked great on 8.1 with.net 4.5 on my laptop and .net 5.0 preview on my desktop.

I went to 10 yesterday and now today I get the error above.

Below is the script.

I will also do screen shot of what services I have enabled.

#Get-VM -ComputerName MS01AHV51QA02 |Where-Object {$_.Name -like "*dfs*"}|Select-Object ComputerName,name,State,MemoryAssigned,Uptime |Format-Table


$HV = (get-adcomputer -Filter 'name -like "*AHV*"' | select name)
try{Remove-Item $env:TEMP\workfile.csv -ErrorAction Stop} catch {}
foreach ($pc in $hv) {
$pc = $pc -replace " ","" -replace "@{NAME=","" -replace "}",""

Try {Get-Service  -ComputerName $pc | Where-Object {$_.DisplayName -like "Hyper-V Virtual Machine Management"} | select MachineName,DisplayName |export-csv $env:TEMP\workfile.csv -NoTypeInformation -Append} catch {"Not autherized for $PC"}

}

$workfile = Import-Csv $env:TEMP\workfile.csv | Sort MachineName 
Clear-host

$workfile.MachineName

$keyword = Read-Host "




What keyword do you want to seach for?"
$lookfor = "*$keyword*"

foreach ($server in $workfile.MachineName) {


Get-VM -ComputerName $server |Where-Object {$_.Name -like $lookfor}|Select-Object ComputerName,name,State,MemoryAssigned,Uptime |Format-Table -HideTableHeaders

}

September 11th, 2015 8:11am

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 8:15am

Windows 10 uses VM.  The error you are getting says the remote machine has an issue.  Perhaps firewall or permissions.

September 11th, 2015 8:29am

I used this just last week. Still I am sure I can find someone here with 8.1 to test this on to see if that is the case.

Thanks

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 8:44am

Just used a coworkers 8.1 desktop and it worked fine. Just like it should. 

September 11th, 2015 8:59am

A Windows 8.1 system with the preview of WMF 5 then upgraded to Windows 10 will have many issues with PowerShell.  Remove the WMF 5 preview before installing Windows 10.

I have just verified this on one 10 upgrade and amnow testing with an upgrade that did not have WMF 5 installed.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 9:27am

I did a fresh install not upgrade.

I have now ran it on 2 Win 10 machines both with fresh installs and 2 8.1 machines.

Both 10 machines have given the same error.

Both 8 machines worked fine.

September 11th, 2015 9:39am

I formatted the disk and did a full install. I kept nothing

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 9:42am

You have a single machine that has a problem but nobody else can reproduce.

I'm afraid that we're not going to be able to solve this break/fix from afar, sight unseen, in a forum.

This is a free peer-to-peer scripting Q&A forum that has no SLA. If you require assistance to fix, you may need to hire a consultant or open a ticket with Microsoft.

September 11th, 2015 10:14am

More then understand and I do applicate your time.

It is not a single machine however the windows 10 machines we have done as a test all have the same issue.

The 8.1 machines do not,

Still I think we do have Microsoft support so that may be a good rout. Also I may be mistaken I thought JRV was able to reproduce it. 

Thank you all again.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 10:20am

I cannot reproduce your issue because you have not really been clear as to what it is. You say "it" doesn't work but fail to define what "it" is.

I noted above that there are issues with upgrades of WMF 5 preview on 8.1

Win 10 WMF uses CimSessions.  Earlier PS VM used WMI.  They are cross compatible but we need to understand the security and protocol schemes. 

I do not get the error you are getting.  On the machine upgraded from 8.1 with WMF 5 preview I do get the error.

September 11th, 2015 11:07am

the error I get it below. I have mine and another user we both did fresh installs of windows 10 not upgrades.  We formatted the disk and did the upgrade.

My laptop is giving the same error as well.   it is a fresh install of 10.

We have windows 10 enterprise. 

I understand you are trying and I do thank you for any assistance.

Get-VM : The Hyper-V module used in this Windows PowerShell session cannot be used for remote management of the server 'MS01AHV53PF04'. Load 
a compatible version of the Hyper-V module, or use Powershell remoting to connect directly to the remote server. For more information, see 
http://go.microsoft.com/fwlink/p/?LinkID=532650.
At C:\Users\9201401145\Google Drive\Scripts\PowerShell\LOOK FOR WHICH SERVER HAS A VIRTUAL MACHINE BY KEYWORD.PS1:29 char:1
+ Get-VM -ComputerName $server |Where-Object {$_.Name -like $lookfor}|S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-VM], VirtualizationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.HyperV.PowerShell.Commands.GetVM

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 12:11pm

Your error message is this:

The Hyper-V module used in this Windows PowerShell session cannot be used for remote management of the server 'MS01AHV53PF04'. Load a compatible version of the Hyper-V module, or use Powershell remoting to connect directly to the remote server. For more information, see http://go.microsoft.com/fwlink/p/?LinkID=532650

Seems pretty clear. You're trying to manage a remote computer with the wrong version of the cmdlet.

September 11th, 2015 12:18pm

My previous post was designed as a hint to help you research.

Try searching for the error message:

http://www.google.com/search?&q=The+Hyper-V+module+used+in+this+Windows+PowerShell+session+cannot+be+used+for+remote+management

Lots of information about that error, as you can see.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 12:22pm

Guys thank you all.
Please don't take this wrong.  I do believe you may be frustrated with the belief that folks like me just come here ask and never research the issue first.
I have been to these sites. You ask me to research and read yet I wonder if either of you read my question.
I know this is volunteer and thanks for trying but please don't assume the worst most of us have done the best we can and use you as a last resource.


JRV you said and I quote "I cannot reproduce your issue because you have not really been clear as to what it is. You say "it" doesn't work but fail to define what "it" is"
I clearly posted the exact error in my first post.

Bill you assume I have not googled this of course I have.  The articles I am reading that you just suggested in the same search I did state use ps remoting.   I clearly said very first post top of page that is not an option for all of our servers.

I hope not to make you mad as I know I make mistakes and perhaps I do not see the solution you are trying to "hint" at.

I gave the error I said cant enable remoting so if you don't know a way around making that happen instead of having me or some other shlub poking at a google search just don't answer or read the question and say you cant do that.


Once again I have no hostility as I type and I do thank you for your time.


  • Edited by Lishron 12 hours 16 minutes ago
September 11th, 2015 2:56pm

If you have searched, then you already know that there is no magical solution to your problem; only workarounds as stated. In any case, this is a Hyper-V question, not a scripting question.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 3:10pm

I only came here as I respect you knowledge thinking perhaps you had a solution.

If you are saying this is the last place to come for info as most others are far better than then net forums I do understand. 

And if everything works fine in hyper v except as related to powershell then this is every bit a fair place to ask such a question.

On my laptop I have kept 10 in hopes MS will fix this issue however on my desktop it is back to 8.1 and all is working fine.

Thanks

September 11th, 2015 3:30pm

JRV you said and I quote "I cannot reproduce your issue because you have not really been clear as to what it is. You say "it" doesn't work but fail to define what "it" is"
I clearly posted the exact error in my first post.


You have not told us what is connecting to what. You have only noted which OS you were having errors on. must describe the whole scenario of the failure.  We cannot guess at what these things are.  Science is and exact science and reporting is not rocket science it is just good observation and recording.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 3:37pm

I only came here as I respect you knowledge thinking perhaps you had a solution.

If you are saying this is the last place to come for info as most others are far better than then net forums I do understand. 

And if everything works fine in hyper v except as related to powershell then this is every bit a fair place to ask such a question.

On my laptop I have kept 10 in hopes MS will fix this issue however on my desktop it is back to 8.1 and all is working fine.

Thanks

September 11th, 2015 3:39pm

Hmm

I put the script in its entirety.

I put the error message in its entirety.

I put the OS.

I put the .net framework.

I put windows features I had installed.

Do you need video?

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 3:41pm

You are still missing the point.  A connection includes two endpoints.  What are the endpoints and how are BOTH configured.  You only ever give the source and at times hint at the target.  Build a matrix of connections and errors along with OS, PS version, remoting config.

There are many causes of this error.  You  ned to start with a clear description then look for matches in the reports and solutions.

If you are not in a domain or are on a wireless net then all bets are off.  Read the reports posted by Bill.

September 11th, 2015 3:46pm

Am I on a network?   Hmmmmmm

You are stretching

I guess out of habit I come here and always hope there is new folks.  I know I could answer a few of these questions better then you just for the fact I can read a problem and eliminate X Y and Z.  You have GREAT knowledge that is unmatched by many and educate so many but we all have our short comings. Lord knows I do.  

Still I don't have the time and I do recognize you are volunteering yours so I will say thank you.

I will not close out the issue as there is no solution to my problem at this time but feel free to do so if it must be.

I do thank you very much and have a good weekend

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 4:02pm

I did not say network I posted "domain".  Not the same thing.  I also noted that wireless links are an issue that has also been noted and not resolved.\

I do not understand why you won't post what you connections are.  Why is it a secret?

September 11th, 2015 4:07pm

Guys thank you all.
Please don't take this wrong.  I do believe you may be frustrated with the belief that folks like me just come here ask and never research the issue first.
I have been to these sites. You ask me to research and read yet I wonder if either of you read my question.
I know this is volunteer and thanks for trying but please don't assume the worst most of us have done the best we can and use you as a last resource.


JRV you said and I quote "I cannot reproduce your issue because you have not really been clear as to what it is. You say "it" doesn't work but fail to define what "it" is"
I clearly posted the exact error in my first post.

Bill you assume I have not googled this of course I have.  The articles I am reading that you just suggested in the same search I did state use ps remoting.   I clearly said very first post top of page that is not an option for all of our servers.

I hope not to make you mad as I know I make mistakes and perhaps I do not see the solution you are trying to "hint" at.

I gave the error I said cant enable remoting so if you don't know a way around making that happen instead of having me or some other shlub poking at a google search just don't answer or read the question and say you cant do that.


Once again I have no hostility as I type and I do thank you for your time.


  • Edited by Lishron Friday, September 11, 2015 6:55 PM
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 6:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics