Hello,
I am getting an error when debugging and have no idea what is causing it.
ERROR: System.Management.Automation.PSRemotingJob
ERROR: At Line: 1 char: 1
I believe I get the error when clicking the button "Get PC Info"
I'm a bit concerned, as I just updated .net, did a Windows Update, and installed several other programs and modules for Electron, and Powershell so I am not sure if these things might have dome something.
Do you need any other log files or anything?
I might also be to blame, and I need to know about the assembly files because I tried pointing Powershell Studio to the newer files. But I do not have any of those files listed in my script or the lines that start with VOIDxxx
Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.174
OS: Windows 10 Pro (64 Bit)
Build: v10.0.18363.0
Thank You,
Wayne
Help with System.Management.Automation.PSRemotingJob error
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- shiroscout
- Posts: 41
- Last visit: Sat Jul 15, 2023 7:13 pm
Help with System.Management.Automation.PSRemotingJob error
- Attachments
-
- ShiroScout.jpg (52.06 KiB) Viewed 3247 times
-
- First Script checking and debugging help.pdf
- (126.99 KiB) Downloaded 113 times
Thank You,
Wayne
Wayne
Re: Help with System.Management.Automation.PSRemotingJob error
PS 6 is likely the cause. Please try running this under PS 5.1 and the error will likley disappear.
PS 6 does not fully support remoting.
PS 6 does not fully support remoting.
- shiroscout
- Posts: 41
- Last visit: Sat Jul 15, 2023 7:13 pm
Re: Help with System.Management.Automation.PSRemotingJob error
I checked and that does not seem to be an issue. Here is my Powershell version info:
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.752
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.752
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.752
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.752
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Thank You,
Wayne
Wayne
- shiroscout
- Posts: 41
- Last visit: Sat Jul 15, 2023 7:13 pm
Re: Help with System.Management.Automation.PSRemotingJob error
Here is my fix. I was using Start-Job and got rid of it as I was using it incorrectly, as I am only using this on local machine, and I think it was calling the psremoting which I did not need.
I changed my code from this:
to this
Issue is Fixed and Resolved.
I changed my code from this:
Code: Select all
$Command = Start-Job -ScriptBlock { Systeminfo -fo "LIST" | Format-List | Out-String }
$Script = (Systeminfo -fo "LIST" | Format-List | Out-String)
Invoke-Expression -Command $Command
$richtextbox1.Text = ($Script)
Code: Select all
$buttonCollectPCInformation_Click = {
$Command = { Systeminfo -fo "LIST" | Format-List | Out-String }
$Script = (Systeminfo -fo "LIST" | Format-List | Out-String)
Invoke-Command -ScriptBlock $command
$richtextbox1.Text = ($Script)
}
Thank You,
Wayne
Wayne
Re: Help with System.Management.Automation.PSRemotingJob error
Doesn't seem to have anything to do with your question. "SystemInfo in a pipeline with FOrma-list makes no sense. The output of systeminfo is text and not objects.
There is no reason for you t use Invoke-Command here. Just run systeminfol
This is all you need to do:
You are making a mistake common to all new users of PowerShell, You are writing too many lines of code that do nothing except make the task harder. Take time to understand each step and test each step at a prompt until you understand what it does.
There is no reason for you t use Invoke-Command here. Just run systeminfol
This is all you need to do:
Code: Select all
$buttonCollectPCInformation_Click = {
$richtextbox1.Text = Systeminfo -fo LIST
}
- shiroscout
- Posts: 41
- Last visit: Sat Jul 15, 2023 7:13 pm
Re: Help with System.Management.Automation.PSRemotingJob error
Hello, Yes friend, you are correct. I overdid it and made it way too hard on myself. I don't know how many hours I worked on getting it corrected, and then I used your code and it immediately did what I needed with no PowerShell flash popup, etc...
That worked exactly as I needed with 90% less code.
That worked exactly as I needed with 90% less code.
Thank You,
Wayne
Wayne
- shiroscout
- Posts: 41
- Last visit: Sat Jul 15, 2023 7:13 pm
Re: Help with System.Management.Automation.PSRemotingJob error
I'll use your good suggestion of trying commands, etc... one-at-a-time, and see what they do, and see if that works as needed without plumping up my code needlessly.
Thank You again.
Wayne
Thank You again.
Wayne
Thank You,
Wayne
Wayne
Re: Help with System.Management.Automation.PSRemotingJob error
I suggest that means it is time for you to learn PowerShell. You can see how much time and effort it will save you.
Start here: https://www.sapien.com/books_training/W ... werShell-4
Start here: https://www.sapien.com/books_training/W ... werShell-4
- shiroscout
- Posts: 41
- Last visit: Sat Jul 15, 2023 7:13 pm
Re: Help with System.Management.Automation.PSRemotingJob error
Well I suppose you are correct.
Awesome, thank you. You should include a link to this free book with every Sapien product purchase. It might save you from many migraine headaches and support mayhem.
Thank you again.
Wayne
Awesome, thank you. You should include a link to this free book with every Sapien product purchase. It might save you from many migraine headaches and support mayhem.
Thank you again.
Wayne
Thank You,
Wayne
Wayne