Browse Source

Location Agnostic Code

master
Josh Mudge 5 years ago
parent
commit
4b90f7f88f
  1. 17
      All/Sign Using OV Cert.md

17
All/Sign Using OV Cert.md

@ -49,19 +49,24 @@ This will allow us to set the name of the program, version, etc. and most import
go-powershell
```
# working directory is dir
dir, err := os.Getwd()
import(
"os"
"fmt"
"log"
)
func main() {
dir, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
```
Might have to create another variable set to the string and add the path.
```
# This command will create the firewall rule.
New-NetFirewallRule -DisplayName "Name of Rule" -Direction Inbound -Program "C:\path\to\app\file.exe" -Action Allow
var dirs string = "New-NetFirewallRule -DisplayName 'Name of Rule' -Direction Inbound -Program '" + dir + "\\server.exe'"
```
You should see something like this:
![](addfirewallrule.png)

Loading…
Cancel
Save