I am writing a script to do a silent install of a program on a windows machine using powershell. However I am hitting an issue where the program does not properly setup the machine’s windows firewall settings. Is their a way for a powershell script that is being remotely executed to add a firewall port exception?
Share
You need to have remoting enabled on remote computer (
Enable-PSRemoting).Enter in the remote session (
Enter-PSSession -ComputerName remotecomputername)Then you can use the native commandline netsh to Enable/Disable Windows firewall using: