Skip to content

Commit

Permalink
[Docs] Update PowerShell code blocks (#16978)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosousa authored and elithrar committed Oct 15, 2024
1 parent 7417684 commit e432069
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ resolver #2
On Windows, open a PowerShell window and run `ipconfig`. The DNS servers should be set to WARP's local DNS proxy IPs.

```powershell
PS C:\> ipconfig
ipconfig
```

```powershell {15-16} output
```txt {15-16} output
Windows IP Configuration
Unknown adapter CloudflareWARP:
Expand Down Expand Up @@ -200,11 +200,10 @@ utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
On Windows, run `ipconfig`. When WARP is turned on, you will see an adapter called `CloudflareWARP` with IP address `172.16.0.2`.

```powershell
PS C:\> ipconfig
ipconfig
```

```powershell {12} output
```txt {12} output
Windows IP Configuration
Unknown adapter CloudflareWARP:
Expand Down Expand Up @@ -299,11 +298,10 @@ To view the entire routing table on Windows, run `netstat -r`.
You can also search the routing table for an IP address. In this example, we see that traffic to `1.1.1.1` is sent through the WARP virtual interface:

```powershell
PS C:\> Find-NetRoute -RemoteIPAddress "1.1.1.1" | Select-Object InterfaceAlias -Last 1
Find-NetRoute -RemoteIPAddress "1.1.1.1" | Select-Object InterfaceAlias -Last 1
```

```powershell output
```txt output
InterfaceAlias
--------------
CloudflareWARP
Expand All @@ -312,11 +310,10 @@ CloudflareWARP
In contrast, this DHCP address is excluded from WARP and uses the default interface:

```powershell
PS C:\> Find-NetRoute -RemoteIPAddress "169.254.0.0" | Select-Object InterfaceAlias -Last 1
Find-NetRoute -RemoteIPAddress "169.254.0.0" | Select-Object InterfaceAlias -Last 1
```

```powershell output
```txt output
InterfaceAlias
--------------
Wi-Fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ To uninstall the WARP client:
1. First, locate the `.msi` package with the following PowerShell command:

```powershell
PS C:\Users\JohnDoe> Get-WmiObject Win32_Product | Where-Object { $_.Name -match "WARP" } | Sort-Object -Property Name | Format-Table IdentifyingNumber, Name, LocalPackage -AutoSize
Get-WmiObject Win32_Product | Where-Object { $_.Name -match "WARP" } | Sort-Object -Property Name | Format-Table IdentifyingNumber, Name, LocalPackage -AutoSize
```

```txt output
IdentifyingNumber Name LocalPackage
----------------- ---- ------------
{5RA4DJWK-13D8-2NSX-QRF8-UANLODWD6D90} Cloudflare WARP C:\WINDOWS\Installer\3f476db.msi
```

2. You can then use the LocalPackage output in the uninstall command. For example,

```bash
```powershell
msiexec /x C:\WINDOWS\Installer\<WARP_RELEASE>.msi /quiet
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ To work around the issue, specify the IPv4 address of the [WARP local DNS proxy]
C:\Users\JohnDoe>nslookup google.com 127.0.2.2
```

Alternatively, use Powershell:
Alternatively, use PowerShell:

```powershell
PS C:\Users\JohnDoe> Resolve-DnsName -Name google.com
Resolve-DnsName -Name google.com
```

## 4G/5G embedded modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ On Windows, you can use PowerShell commands if `dig` is not available.
To test DNS:

```powershell
PS C:\Windows\system32> Resolve-DnsName -Name _v2-origintunneld._tcp.argotunnel.com SRV
Resolve-DnsName -Name _v2-origintunneld._tcp.argotunnel.com SRV
```

```txt output
Name Type TTL Section NameTarget Priority Weight Port
---- ---- --- ------- ---------- -------- ------ ----
_v2-origintunneld._tcp.argotunnel.com SRV 112 Answer region2.v2.argotunnel.com 2 1 7844
Expand All @@ -193,8 +195,10 @@ _v2-origintunneld._tcp.argotunnel.com SRV 112 Answer region1.v2.a
To test ports:

```powershell
PS C:\Cloudflared\bin> tnc region1.v2.argotunnel.com -port 443
tnc region1.v2.argotunnel.com -port 443
```

```txt output
ComputerName : region1.v2.argotunnel.com
RemoteAddress : 198.41.192.227
RemotePort : 443
Expand All @@ -204,8 +208,10 @@ TcpTestSucceeded : True
```

```powershell
PS C:\Cloudflared\bin> tnc region1.v2.argotunnel.com -port 7844
tnc region1.v2.argotunnel.com -port 7844
```

```txt output
ComputerName : region1.v2.argotunnel.com
RemoteAddress : 198.41.192.227
RemotePort : 7844
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To update `cloudflared` for a tunnel [created through the dashboard](/cloudflare
Run the following command:

```powershell
PS C:\> cloudflared update
cloudflared update
```

This updates `cloudflared` and automatically restarts the service.
Expand Down Expand Up @@ -139,14 +139,14 @@ Windows systems require services to have a unique name and display name. You can
1. Install and configure `cloudflared`.
2. Next, create a service with a unique name and point to the `cloudflared` executable and configuration file.

```bash
```powershell
sc.exe create <unique-name> binPath='<path-to-exe>' --config '<path-to-config>' displayname="Unique Name"
```

3. Proceed to create additional services with unique names.

4. You can now start each unique service.

```bash
```powershell
sc.exe start <unique-name>
```
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ When setting up new device posture checks, we recommend first testing them witho
2. Use the `Get-AuthenticodeSignature` command to find the thumbprint. For example:

```powershell
PS C:\Users\JohnDoe> Get-AuthenticodeSignature -FilePath c:\myfile.exe
Get-AuthenticodeSignature -FilePath c:\myfile.exe
```

## Determine the SHA-256 value
Expand All @@ -108,7 +108,7 @@ The SHA-256 value almost always changes between versions of a file/application.
2. Use the `get-filehash` command to find the SHA256 value of the file. For example:

```powershell
PS C:\Users\JohnDoe> get-filehash -path "C:\myfile.exe" -Algorithm SHA256 | format-list
get-filehash -path "C:\myfile.exe" -Algorithm SHA256 | format-list
```

## How WARP checks for an application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ You can use the following commands to check if a client certificate is properly
2. To search the local machine trust store for a certificate with a specific common name, run the following command:

```powershell
PS C:\Users\JohnDoe> Get-ChildItem Cert:\LocalMachine\My\ | where{$_.Subject -like "*<COMMON_NAME>*"}
Get-ChildItem Cert:\LocalMachine\My\ | where{$_.Subject -like "*<COMMON_NAME>*"}
```

3. To search the user trust store for a certificate with a specific common name, run the following command:

```powershell
PS C:\Users\JohnDoe> Get-ChildItem Cert:\CurrentUser\My\ | where{$_.Subject -like "*<COMMON_NAME>*"}
Get-ChildItem Cert:\CurrentUser\My\ | where{$_.Subject -like "*<COMMON_NAME>*"}
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ macOS has two firewalls: an application-based firewall and a port-based firewall
1. Open PowerShell and run:

```powershell
PS C:\Users\JohnDoe> Get-NetFirewallProfile -PolicyStore ActiveStore -Name Public
Get-NetFirewallProfile -PolicyStore ActiveStore -Name Public
```

2. Verify that **Enabled** is `True`.
Loading

0 comments on commit e432069

Please sign in to comment.