Yes i did a search. Mostly ones that comes up are not what i’m looking but could be the word i use to search.
current situation:
logon server01 and open powershell
run c:\Scripts\Collection.ps1 option1 option2 option3
I want to bypass remote logon,
i can access \server01\Scripts without any credential
can i run ps1 script from \server01\Scripts\collection.ps1 options1 option2 option3?
example Invoke-Command -ComputerName Server01 -FilePath c:\Scripts\Collection.ps1 option1 option2 option3
or would be better if i can run from window batch file because i have scripted for IF and SET for options1, 2, 3
you probably wondered, have i test it yet, no not yet. i want to make sure it is even close to working. Dont want to cause to much traffic issue if command does’t work.
How much time would it have taken you to write a mini test script and try it? And how long did it take you to come here, create an account and write this question?
And how much traffic can it cause with a few lines of code to test?
It took me about 30 seconds to Google for “Powershell run script remote including arguments” and the first hit was this: