none
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

    19/شوال/1440 08: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 20/شوال/1440 12:06 م
    • تم وضع علامة كإجابة بواسطة Araimondi 20/شوال/1440 05:54 م
    19/شوال/1440 09:34 م

جميع الردود

  • Hi, 

    Check this link, maybe it solve your problem.

    If the error message continues then, is it possible to post the script?


    Please, If you think your question has been answered click "Mark as Answer" if just helped click "Vote as helpful". This can be beneficial to other community members reading this forum thread.

    19/شوال/1440 08:46 م
  • Hi Here is the scipt

    net stop ccmexec
    sc.exe config "ccmexec" start= auto
    Set-Location Cert:\LocalMachine\SMS\
    gci * | where {$_.Subject -like "CN=SMS*"}|Remove-Item -Force
    Set-Location Cert:\LocalMachine\My\
    gci * | where {$_.Subject -like "CN=Blast*"}|Remove-Item -Force
    Remove-Item -LiteralPath "C:\Windows\SMSCFG.ini" -Force -Confirm:$false
    net start ccmexec

    19/شوال/1440 09:22 م
  • 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 20/شوال/1440 12:06 م
    • تم وضع علامة كإجابة بواسطة Araimondi 20/شوال/1440 05:54 م
    19/شوال/1440 09:34 م
  • DUDE THANK YOU!!!!!!! 
    • تم وضع علامة كإجابة بواسطة Araimondi 20/شوال/1440 12:23 ص
    • تم إلغاء علامة كإجابة بواسطة Bill_StewartModerator 21/شوال/1440 01:37 م
    19/شوال/1440 09:44 م
  • DUDE THANK YOU!!!!!!! 

    Welcome.  Please mark the answer that helped and not your response. People find things by answers in tech forums.

    \_(ツ)_/

    • تم وضع علامة كإجابة بواسطة Araimondi 20/شوال/1440 05:54 م
    • تم إلغاء علامة كإجابة بواسطة Bill_StewartModerator 21/شوال/1440 01:37 م
    20/شوال/1440 02:55 ص