Run Windows PowerShell via GPO

Hi all,

I have a problem with running one PS script, via GPO. The script is named Hide-WUUpdate, and can be downloaded from https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc 

When imported and run it is used to hide a specific Windows Update. Now if I log to computer, open PS and run it via command it is going to hide Skype from list of updates..or any other updated.
PS C:\WINDOWS\system32> Hide-WUUpdate -Title "Skype*" -KBArticleID "KB2876229" -MicrosoftUpdate -Confirm:$false

Now I have a problem when I run it via gpo. Can some1 post how to run it, specially how to enter this commands, eg. parameters to run?
skype.jpg
LVL 19
IvanSystem EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

McKnifeCommented:
"Now I have a problem when I run it via gpo" - fine, what problem?
To deploy a script, save the commands to a .ps1 file (power shell script file) and run that script from your domain startup batchscript like
powershell yourscript.ps1

You need to make sure, that script execution is turned on, this can be done by GPO, see http://windowsitpro.com/powershell/controlling-powershell-execution-policy-settings-domain
(set to enabled+allow local and remote signed scripts)
0
IvanSystem EngineerAuthor Commented:
Hi,

can you explain that a bit more? This script has hundreds of line of code, and I cannot put additional lines of commands that need to be done in it, because I don't know where to put them. I only know how to run it when I enter commands in shell, like I wrote before.
So I need a step by step guide for dummies.. I have tried like in the picture and it does not work.
How would I reconfigure script, or create a batch that will run this script with additional commands?

If it is to complicated, then nvm :)

Regards,
gpo.jpg
0
McKnifeCommented:
This is how you configure a domain startup script: https://technet.microsoft.com/en-us/library/cc779329%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396
So check whether you already have a startup script running inside a policy by starting rsop.msc at one client. If not, create one.
If there is one, like I wrote, just add one line:
powershell yourscript.ps1

Open in new window

This will start yourscript.ps1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.