Powershel Question RRS feed

  • คำถาม

  • Hi Gys

    Im hoping someone can help me. i am VERY new to Powershell and made a script to delete some files on reomte machines It worked all day Thursday and Friday and when i tried to run today I get the below error and I have no idea why

    Invoke-command -comp (Get-Content C:\Users\AR\Desktop\MissingVDI_One.txt)  -filepath C:\Users\AR\Desktop\Powershell\DeleteGUID.ps1

    The error is

    nvoke-Command : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
    At line:1 char:22

    I used the same exact script wwith the txt file and ps1 imn the same place with no issues now it gets this

    22 มิถุนายน 2562 20:31


  • The error has nothing to do with the script.  It is from the "Invoke" as the error states.  The script file has not even been loaded or evaluated.

    There is a blank line in the text file.  Remove the blank line and the error will go away.  Your friends probably sabotaged the file to watch you squirm.


    • เสนอเป็นคำตอบโดย BOfH-666 23 มิถุนายน 2562 12:06
    • ทำเครื่องหมายเป็นคำตอบโดย Araimondi 23 มิถุนายน 2562 17:54
    22 มิถุนายน 2562 21:34