• Profile picture of Amir Mir

    Amir Mir replied to the topic Invoke-Command returns additional properties forcibly in the forum General PowerShell Q&A 1 month ago

    I figured out what went wrong, instead of filtering everything inside the ScriptBlock, I was filtering outside the ScriptBlock so that’s why the 3 properties were showing up. All I had to do was to put the } at the end of the line. see code examples below.

    Code that returned the 3 properties.

    Invoke-Command…. -ScriptBlock {…
    LastBackupDate }[Read more]

  • Profile picture of Amir Mir

    Amir Mir replied to the topic Invoke-Command returns additional properties forcibly in the forum General PowerShell Q&A 1 month ago

    Hello Olaf, thank you for the reply. This makes sense but what’s really bothering me is that the fact that I didn’t have these properties coming back previously, I mean like literally this started happening after I upgraded my system to the windows upgrade 1803 this morning. Could this be a reason?? I really want to duplicate the issue but the…[Read more]

  • Profile picture of Amir Mir

    Amir Mir started the topic Invoke-Command returns additional properties forcibly in the forum General PowerShell Q&A 1 month ago

     

    Hello, I have been running the same code previously and I never saw the 3 properties PSComputerName, RunspaceId and PSShowComputerNamereturn return previously but now all of a sudden, I see them. I am stumped as to why?? The only difference was that I was running PS ver 5.0 and now its 5.1.

    Please help me understand and eliminate these 3…[Read more]

  • Profile picture of Amir Mir

    Amir Mir replied to the topic Remote execution – slow in the forum General PowerShell Q&A 1 month ago

    Mr. Jones, I ran the Trace-Command
    Trace-Command -Name ParameterBinding -Expression {Invoke-Command -FilePath “C:UsersMSA050415DocumentsWindowsPowerShellScriptsInvoke_cmd_bkup.ps1” -ComputerName SERVER} -PSHost
    and the output below really didn’t help me. Am I using the right tracesource? What should I be doing instead if this is not sufficient?…[Read more]

  • Profile picture of Amir Mir

    Amir Mir replied to the topic Remote execution – slow in the forum General PowerShell Q&A 1 month ago

    I’ll give that Trace-Command a shot to figure out because these are simple scripts querying SQL Server to get basic info and if it takes 40-45 seconds, it’s a deterrent for my colleagues to use as they are all BASH guys and I want to make PowerShell work and look good ๐Ÿ˜‰

    Also, my other question was about variables. I have also noticed that when…[Read more]

  • Profile picture of Amir Mir

    Amir Mir replied to the topic Remote execution – slow in the forum General PowerShell Q&A 1 month ago

    Hello Mr. Jones, I just finished reading your book “PowerShell in a month of lunches” and I first and foremost have to thank you for co-authoring such a wonderful book. And because of this book, instead of googling scripts, I was able to write my scripts from scratch. So a big thanks to you andย  Mr. Hicks!!

    So after reading the chapter 13 of the…[Read more]

  • Profile picture of Amir Mir

    Amir Mir replied to the topic Remote execution – slow in the forum General PowerShell Q&A 1 month ago

    So if we were to use the Invoke-command but referencing the a script that is locally stored on the host of the console, will it take the entire content of the script, go to the remote computer and then execute it locally and only bring back the results? Am I understanding this correctly?

  • Profile picture of Amir Mir

    Amir Mir replied to the topic Get-Help works every time… in the forum Teaching PowerShell 1 month ago

    Haha..love it. Fits perfectly!!!

  • Profile picture of Amir Mir

    Amir Mir posted a new activity comment 1 month ago

    In reply to: Amir Mir joined the group Teaching PowerShell View

    @ctmcisco Hello Francisco, I would really like to join the Chicago PowerShell group, can you please forward me the info about the group and how I can join it and attend the first meeting on Oct 9th?
    You can email me the details at โ€“> amirandmir AT gmail DOT com

  • Profile picture of Amir Mir

    Amir Mir posted a new activity comment 1 month ago

    In reply to: Amir Mir joined the group Teaching PowerShell View

    Hello Francisco, I would really like to join the Chicago PowerShell group, can you please forward me the info about the group and how I can join it and attend the first meeting on Oct 9th?
    You can email me the details at –> amirandmir AT gmail DOT com

  • Profile picture of Amir Mir

    Amir Mir joined the group Group logo of Teaching PowerShellGroup logo of Teaching PowerShellTeaching PowerShell 1 month ago

    • Hello Francisco, I would really like to join the Chicago PowerShell group, can you please forward me the info about the group and how I can join it and attend the first meeting on Oct 9th?
      You can email me the details at –> amirandmir AT gmail DOT com

    • @ctmcisco Hello Francisco, I would really like to join the Chicago PowerShell group, can you please forward me the info about the group and how I can join it and attend the first meeting on Oct 9th?
      You can email me the details at โ€“> amirandmir AT gmail DOT com

  • Profile picture of Amir Mir

    Amir Mir became a registered member 1 month ago