[scripts] Force Group policy update in power shell

Invoke-Command -ComputerName "AnyPC" {
$cmd1 = "cmd.exe"
$arg1 = "/c"
$arg2 = "echo y | gpupdate /force /wait:0"
&$cmd1 $arg1 $arg2
}

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top