Skip to content

Latest commit

 

History

History
1696 lines (1288 loc) · 44.2 KB

File metadata and controls

1696 lines (1288 loc) · 44.2 KB

Example Output

Real output captured from every exported function against a live Pi-hole v6 server, generated by tools/Update-ExampleOutput.ps1. Values (query counts, IDs, timestamps, etc.) reflect whatever that specific server had at capture time - the shape of the output is what matters here, not the exact numbers.

Regenerate with:

./tools/Update-ExampleOutput.ps1
# or, to also capture the small number of functions with real side effects on a live server:
./tools/Update-ExampleOutput.ps1 -IncludeDisruptive

Actions

Invoke-PiHoleFlushNetwork

Invoke-PiHoleFlushNetwork -PiHoleServer $PiHoleServer -Password $Password
Status : Flushed

_(A real example captured previously - not re-run by default since this function has a real side effect on a live server. Pass -IncludeDisruptive to capture a fresh one.)_

Invoke-PiHoleFlushLogs

Invoke-PiHoleFlushLogs -PiHoleServer $PiHoleServer -Password $Password
Status : Flushed

_(A real example captured previously - not re-run by default since this function has a real side effect on a live server. Pass -IncludeDisruptive to capture a fresh one.)_

Restart-PiHoleDnsService

Restart-PiHoleDnsService -PiHoleServer $PiHoleServer -Password $Password
Status : Restarted

_(A real example captured previously - not re-run by default since this function has a real side effect on a live server. Pass -IncludeDisruptive to capture a fresh one.)_

Update-PiHoleActionsGravity

Rebuilds the entire gravity database - typically takes 1-2 minutes.

Update-PiHoleActionsGravity -PiHoleServer $PiHoleServer -Password $Password
Status : Completed

_(A real example captured previously - not re-run by default since this function has a real side effect on a live server. Pass -IncludeDisruptive to capture a fresh one.)_

DNS Control

Get-PiHoleDnsBlockingStatus

Get-PiHoleDnsBlockingStatus -PiHoleServer $PiHoleServer -Password $Password

Blocking : enabled
Timer    : 0

Set-PiHoleDnsBlocking

Set-PiHoleDnsBlocking -PiHoleServer $PiHoleServer -Password $Password -Blocking False -TimeInSeconds 60
_Not captured this run - re-run with -IncludeDisruptive to include a live example._

Group Management

New-PiHoleGroup

New-PiHoleGroup -PiHoleServer $PiHoleServer -Password $Password -GroupName "PiHoleShellDocsExampleGroup" -Comment "Example group"

Name         : PiHoleShellDocsExampleGroup
Comment      : Example group
Enabled      : True
Id           : 63
DateAdded    : 10/6/2026 10:06:30 PM
DateModified : 10/6/2026 10:06:30 PM

Get-PiHoleGroup

Get-PiHoleGroup -PiHoleServer $PiHoleServer -Password $Password

Name         : Default
Comment      : The default group
Enabled      : True
Id           : 0
DateAdded    : 6/25/2025 12:32:45 AM
DateModified : 6/25/2025 12:32:45 AM

Name         : testgroup2
Comment      : 
Enabled      : True
Id           : 2
DateAdded    : 7/1/2025 10:13:36 PM
DateModified : 7/1/2025 10:13:36 PM

Name         : testgroup1
Comment      : 
Enabled      : True
Id           : 3
DateAdded    : 7/1/2025 10:13:40 PM
DateModified : 7/1/2025 10:13:40 PM

Name         : RealFunctionTest
Comment      : 
Enabled      : True
Id           : 44
DateAdded    : 9/30/2026 8:48:26 AM
DateModified : 9/30/2026 8:48:26 AM

Name         : PiHoleShellDocsExampleGroup
Comment      : Example group
Enabled      : True
Id           : 63
DateAdded    : 10/6/2026 10:06:30 PM
DateModified : 10/6/2026 10:06:30 PM

Update-PiHoleGroup

Update-PiHoleGroup -PiHoleServer $PiHoleServer -Password $Password -GroupName "PiHoleShellDocsExampleGroup" -Enabled $false

Name         : PiHoleShellDocsExampleGroup
Comment      : Example group
Enabled      : False
Id           : 63
DateAdded    : 10/6/2026 10:06:30 PM
DateModified : 10/6/2026 10:06:48 PM

Remove-PiHoleGroup

Remove-PiHoleGroup -PiHoleServer $PiHoleServer -Password $Password -GroupName "PiHoleShellDocsExampleGroup"

Name   : PiHoleShellDocsExampleGroup
Status : Deleted

List Management

Add-PiHoleList

Add-PiHoleList -PiHoleServer $PiHoleServer -Password $Password -Address "https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt" -Type Block -Comment "Example list"

Address        : https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt
Comment        : Example list
Groups         : {Default}
Enabled        : True
Id             : 81
DateAdded      : 10/6/2026 10:07:25 PM
DateModified   : 10/6/2026 10:07:25 PM
Type           : Block
DateUpdated    : 
Number         : 0
InvalidDomains : 0
AbpEntries     : 0
Status         : 0

Get-PiHoleList

Get-PiHoleList -PiHoleServer $PiHoleServer -Password $Password

Address        : https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Comment        : 
Groups         : {Default}
Enabled        : True
Id             : 51
DateAdded      : 7/6/2025 2:20:13 AM
DateModified   : 7/6/2025 2:20:13 AM
Type           : block
DateUpdated    : 7/6/2025 2:20:13 AM
Number         : 72234
InvalidDomains : 1
AbpEntries     : 0
Status         : 2

Address        : https://adaway.org/hosts.txt
Comment        : 
Groups         : {Default}
Enabled        : True
Id             : 52
DateAdded      : 7/6/2025 2:20:40 AM
DateModified   : 7/6/2025 2:20:40 AM
Type           : block
DateUpdated    : 7/6/2025 2:20:40 AM
Number         : 6540
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

Address        : https://v.firebog.net/hosts/AdguardDNS.txt
Comment        : 
Groups         : {Default}
Enabled        : True
Id             : 53
DateAdded      : 7/6/2025 2:20:46 AM
DateModified   : 7/6/2025 2:20:46 AM
Type           : block
DateUpdated    : 7/6/2025 2:20:46 AM
Number         : 176582
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

Address        : https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt
Comment        : 
Groups         : {Default}
Enabled        : True
Id             : 54
DateAdded      : 7/6/2025 2:20:59 AM
DateModified   : 7/6/2025 2:20:59 AM
Type           : block
DateUpdated    : 7/6/2025 2:20:59 AM
Number         : 42531
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

Address        : https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
Comment        : 
Groups         : {Default}
Enabled        : True
Id             : 55
DateAdded      : 7/6/2025 2:21:09 AM
DateModified   : 7/6/2025 2:21:09 AM
Type           : block
DateUpdated    : 7/6/2025 2:21:09 AM
Number         : 2700
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

_(showing 5 of 15 results)_

Update-PiHoleList

Update-PiHoleList -PiHoleServer $PiHoleServer -Password $Password -Address "https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt" -Type Block -Enabled $false

Address        : https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt
Comment        : Example list
Groups         : {Default}
Enabled        : False
Id             : 81
DateAdded      : 10/6/2026 10:07:25 PM
DateModified   : 10/6/2026 10:07:58 PM
Type           : Block
DateUpdated    : 
Number         : 0
InvalidDomains : 0
AbpEntries     : 0
Status         : 0

Search-PiHoleListDomain

Search-PiHoleListDomain -PiHoleServer $PiHoleServer -Password $Password -Domain "doubleclick.net"

Domain         : doubleclick.net
Address        : https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Comment        : 
Enabled        : True
Id             : 51
Type           : block
Groups         : {0}
DateAdded      : 7/6/2025 2:20:13 AM
DateModified   : 7/6/2025 2:20:13 AM
DateUpdated    : 10/2/2026 9:10:24 PM
Number         : 72234
InvalidDomains : 1
AbpEntries     : 0
Status         : 2

Domain         : doubleclick.net
Address        : https://adaway.org/hosts.txt
Comment        : 
Enabled        : True
Id             : 52
Type           : block
Groups         : {0}
DateAdded      : 7/6/2025 2:20:40 AM
DateModified   : 7/6/2025 2:20:40 AM
DateUpdated    : 7/6/2025 2:25:21 AM
Number         : 6540
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

Domain         : doubleclick.net
Address        : https://v.firebog.net/hosts/AdguardDNS.txt
Comment        : 
Enabled        : True
Id             : 53
Type           : block
Groups         : {0}
DateAdded      : 7/6/2025 2:20:46 AM
DateModified   : 7/6/2025 2:20:46 AM
DateUpdated    : 10/2/2026 9:43:40 AM
Number         : 176582
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

Domain         : doubleclick.net
Address        : https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt
Comment        : 
Enabled        : True
Id             : 54
Type           : block
Groups         : {0}
DateAdded      : 7/6/2025 2:20:59 AM
DateModified   : 7/6/2025 2:20:59 AM
DateUpdated    : 12/27/2025 9:28:21 PM
Number         : 42531
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

Domain         : doubleclick.net
Address        : https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
Comment        : 
Enabled        : True
Id             : 55
Type           : block
Groups         : {0}
DateAdded      : 7/6/2025 2:21:09 AM
DateModified   : 7/6/2025 2:21:09 AM
DateUpdated    : 6/6/2026 11:13:26 PM
Number         : 2700
InvalidDomains : 0
AbpEntries     : 0
Status         : 2

_(showing 5 of 7 results)_

Remove-PiHoleList

Remove-PiHoleList -PiHoleServer $PiHoleServer -Password $Password -Address "https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt" -Type Block

Address : https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt
Type    : Block
Status  : Removed

Domain Management

New-PiHoleDomain

New-PiHoleDomain -PiHoleServer $PiHoleServer -Password $Password -Domain "piholeshell-docs-example.com" -Type Allow -Kind Exact -Comment "Example domain"

Domain       : piholeshell-docs-example.com
Unicode      : piholeshell-docs-example.com
Type         : Allow
Kind         : Exact
Comment      : Example domain
Groups       : {Default}
Enabled      : True
Id           : 18
DateAdded    : 10/6/2026 10:08:36 PM
DateModified : 10/6/2026 10:08:36 PM

Get-PiHoleDomain

Get-PiHoleDomain -PiHoleServer $PiHoleServer -Password $Password

Domain       : piholeshell-docs-example.com
Unicode      : piholeshell-docs-example.com
Type         : allow
Kind         : exact
Comment      : Example domain
Groups       : {Default}
Enabled      : True
Id           : 18
DateAdded    : 10/6/2026 10:08:36 PM
DateModified : 10/6/2026 10:08:36 PM

Update-PiHoleDomain

Update-PiHoleDomain -PiHoleServer $PiHoleServer -Password $Password -Domain "piholeshell-docs-example.com" -Type Allow -Kind Exact -Enabled $false

Domain       : piholeshell-docs-example.com
Unicode      : piholeshell-docs-example.com
Type         : Allow
Kind         : Exact
Comment      : Example domain
Groups       : {Default}
Enabled      : False
Id           : 18
DateAdded    : 10/6/2026 10:08:36 PM
DateModified : 10/6/2026 10:09:10 PM

Remove-PiHoleDomain

Remove-PiHoleDomain -PiHoleServer $PiHoleServer -Password $Password -Domain "piholeshell-docs-example.com" -Type Allow -Kind Exact

Domain : piholeshell-docs-example.com
Type   : Allow
Kind   : Exact
Status : Removed

Client Management

New-PiHoleClient

New-PiHoleClient -PiHoleServer $PiHoleServer -Password $Password -Client "192.168.99.99" -Comment "Example client"

Client       : 192.168.99.99
Name         : 
Comment      : Example client
Groups       : {Default}
Id           : 20
DateAdded    : 10/6/2026 10:09:40 PM
DateModified : 10/6/2026 10:09:40 PM

Get-PiHoleClient

Get-PiHoleClient -PiHoleServer $PiHoleServer -Password $Password

Client       : 192.168.99.99
Name         : 
Comment      : Example client
Groups       : {Default}
Id           : 20
DateAdded    : 10/6/2026 10:09:40 PM
DateModified : 10/6/2026 10:09:40 PM

Get-PiHoleClientSuggestion

Get-PiHoleClientSuggestion -PiHoleServer $PiHoleServer -Password $Password

HwAddr    : ip-127.0.0.1
MacVendor : 
LastQuery : 10/6/2026 10:06:14 PM
Addresses : 127.0.0.1
Names     : localhost

HwAddr    : 74:56:3c:bb:f4:0b
MacVendor : Giga-Byte Technology Co.,Ltd.
LastQuery : 10/6/2026 10:03:16 PM
Addresses : 192.168.1.162
Names     :

Update-PiHoleClient

Update-PiHoleClient -PiHoleServer $PiHoleServer -Password $Password -Client "192.168.99.99" -Comment "Updated comment"

Client       : 192.168.99.99
Name         : 
Comment      : Updated comment
Groups       : {Default}
Id           : 20
DateAdded    : 10/6/2026 10:09:40 PM
DateModified : 10/6/2026 10:10:18 PM

Remove-PiHoleClient

Remove-PiHoleClient -PiHoleServer $PiHoleServer -Password $Password -Client "192.168.99.99"

Client : 192.168.99.99
Status : Removed

Metrics

Get-PiHoleStatsSummary

Get-PiHoleStatsSummary -PiHoleServer $PiHoleServer -Password $Password

Total          : 72
Blocked        : 8
PercentBlocked : 11.1111106872559
UniqueDomains  : 16
Forwarded      : 27
Cached         : 37
Frequency      : 0
Types          : @{A=18; AAAA=17; ANY=0; SRV=0; SOA=0; PTR=37; TXT=0; NAPTR=0; MX=0; DS=0; RRSIG=0; DNSKEY=0; NS=0; SVCB=0; HTTPS=0; OTHER=0}
Status         : @{Unknown=0; Gravity=8; Forwarded=27; Cache=37; Regex=0; DenyList=0; ExternalBlockedIp=0; ExternalBlockedNull=0; ExternalBlockedNxra=0; GravityCname=0; RegexCname=0; DenyListCname=0; Retired=0; RetiredDnssec=0; InProgress=0; Dbbusy=0; SpecialDomain=0; CacheStale=0; ExternalBlockedEde15=0}
Replies        : @{Unknown=7; Nodata=3; Nxdomain=2; Cname=0; Ip=25; Domain=35; Rrname=0; ServFail=0; Refused=0; Notimp=0; Other=0; Dnssec=0; None=0; Blob=0}
Clients        : @{Active=2; Total=2}
Gravity        : @{DomainsBeingBlocked=526957; LastUpdate=1791140144}

Get-PiHoleStatsRecentBlocked

Get-PiHoleStatsRecentBlocked -PiHoleServer $PiHoleServer -Password $Password

Blocked : googlesyndication.com

Get-PiHoleStatsQueryType

Get-PiHoleStatsQueryType -PiHoleServer $PiHoleServer -Password $Password

Type  : A
Count : 18

Type  : AAAA
Count : 17

Type  : ANY
Count : 0

Type  : SRV
Count : 0

Type  : SOA
Count : 0

_(showing 5 of 16 results)_

Get-PiHoleStatsTopDomain

Get-PiHoleStatsTopDomain -PiHoleServer $PiHoleServer -Password $Password

Domain : 1.0.0.127.in-addr.arpa
Count  : 31

Domain : bbc.com
Count  : 4

Domain : example.com
Count  : 4

Domain : python.org
Count  : 4

Domain : wikipedia.org
Count  : 4

_(showing 5 of 10 results)_

Get-PiHoleStatsTopClient

Get-PiHoleStatsTopClient -PiHoleServer $PiHoleServer -Password $Password

IP    : 127.0.0.1
Name  : localhost
Count : 37

IP    : 192.168.1.162
Name  : 
Count : 35

Get-PiHoleStatsUpstream

Get-PiHoleStatsUpstream -PiHoleServer $PiHoleServer -Password $Password

TotalQueries     : 72
ForwardedQueries : 27
Upstreams        : {@{Ip=blocklist; Name=blocklist; Port=-1; Count=8; ResponseTime=0; Variance=0}, @{Ip=cache; Name=cache; Port=-1; Count=37; ResponseTime=0; Variance=0}, @{Ip=8.8.4.4; Name=dns.google; Port=53; Count=23; ResponseTime=0; Variance=0}, @{Ip=8.8.8.8; Name=dns.google; Port=53; Count=4; ResponseTime=0; Variance=0}}

Get-PiHoleStatsQuerySuggestions

Get-PiHoleStatsQuerySuggestions -PiHoleServer $PiHoleServer -Password $Password

Domain     : {1.0.0.127.in-addr.arpa, bbc.com, example.com, python.org…}
ClientIp   : {127.0.0.1, 192.168.1.162}
ClientName : {localhost}
Upstream   : {blocklist, cache, 8.8.4.4#53 (dns.google), 8.8.8.8#53 (dns.google)…}
Type       : {A, AAAA, ANY, SRV…}
Status     : {UNKNOWN, GRAVITY, FORWARDED, CACHE…}
Reply      : {UNKNOWN, NODATA, NXDOMAIN, CNAME…}
Dnssec     : {UNKNOWN, SECURE, INSECURE, BOGUS…}

Get-PiHoleStatsDatabaseSummary

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleStatsDatabaseSummary -PiHoleServer $PiHoleServer -Password $Password

SumQueries     : 56
SumBlocked     : 8
PercentBlocked : 14.2857141494751
TotalClients   : 2

Get-PiHoleStatsDatabaseQueryType

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleStatsDatabaseQueryType -PiHoleServer $PiHoleServer -Password $Password

Type  : A
Count : 17

Type  : AAAA
Count : 0

Type  : ANY
Count : 0

Type  : SRV
Count : 0

Type  : SOA
Count : 21

_(showing 5 of 16 results)_

Get-PiHoleStatsDatabaseTopDomain

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleStatsDatabaseTopDomain -PiHoleServer $PiHoleServer -Password $Password

Domain : 1.0.0.127.in-addr.arpa
Count  : 15

Domain : python.org
Count  : 4

Domain : bbc.com
Count  : 4

Domain : wikipedia.org
Count  : 4

Domain : example.com
Count  : 4

_(showing 5 of 10 results)_

Get-PiHoleStatsDatabaseTopClient

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleStatsDatabaseTopClient -PiHoleServer $PiHoleServer -Password $Password

IP    : 192.168.1.162
Name  : 
Count : 27

IP    : 127.0.0.1
Name  : localhost
Count : 21

Get-PiHoleStatsDatabaseUpstream

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleStatsDatabaseUpstream -PiHoleServer $PiHoleServer -Password $Password

TotalQueries     : 56
ForwardedQueries : 27
Upstreams        : {@{Ip=1; Name=; Port=-1; Count=23; ResponseTime=0; Variance=0}, @{Ip=2; Name=; Port=-1; Count=4; ResponseTime=0; Variance=0}, @{Ip=cache; Name=cache; Port=-1; Count=21; ResponseTime=0; Variance=0}, @{Ip=blocklist; Name=blocklist; Port=-1; Count=8; ResponseTime=0; Variance=0}}

Get-PiHoleQuery

Returns the most recent 100 queries by default; supports many optional filters (domain, client, type, status...) - see Get-PiHoleStatsQuerySuggestions for valid filter values.

Get-PiHoleQuery -PiHoleServer $PiHoleServer -Password $Password -Length 5

Id       : 394
Time     : 10/6/2026 10:06:15 PM
Type     : PTR
Domain   : 4.4.8.8.in-addr.arpa
Cname    : 
Status   : FORWARDED
Client   : @{Ip=127.0.0.1; Name=localhost}
Dnssec   : UNKNOWN
Reply    : @{Type=DOMAIN; Time=0.0241849422454834}
ListId   : 
Upstream : 8.8.8.8#53
Ede      : @{Code=-1; Text=}

Id       : 393
Time     : 10/6/2026 10:06:15 PM
Type     : PTR
Domain   : 8.8.8.8.in-addr.arpa
Cname    : 
Status   : FORWARDED
Client   : @{Ip=127.0.0.1; Name=localhost}
Dnssec   : UNKNOWN
Reply    : @{Type=DOMAIN; Time=0.0249054431915283}
ListId   : 
Upstream : 8.8.8.8#53
Ede      : @{Code=-1; Text=}

Id       : 392
Time     : 10/6/2026 10:06:15 PM
Type     : PTR
Domain   : 162.1.168.192.in-addr.arpa
Cname    : 
Status   : CACHE
Client   : @{Ip=127.0.0.1; Name=localhost}
Dnssec   : UNKNOWN
Reply    : @{Type=NXDOMAIN; Time=0.0157008171081543}
ListId   : 
Upstream : 
Ede      : @{Code=-1; Text=}

Id       : 391
Time     : 10/6/2026 10:06:15 PM
Type     : PTR
Domain   : 1.0.0.127.in-addr.arpa
Cname    : 
Status   : CACHE
Client   : @{Ip=127.0.0.1; Name=localhost}
Dnssec   : UNKNOWN
Reply    : @{Type=DOMAIN; Time=0.0260829925537109}
ListId   : 
Upstream : 
Ede      : @{Code=-1; Text=}

Id       : 390
Time     : 10/6/2026 10:03:17 PM
Type     : PTR
Domain   : 4.4.8.8.in-addr.arpa
Cname    : 
Status   : FORWARDED
Client   : @{Ip=127.0.0.1; Name=localhost}
Dnssec   : UNKNOWN
Reply    : @{Type=DOMAIN; Time=0.0180368423461914}
ListId   : 
Upstream : 8.8.4.4#53
Ede      : @{Code=-1; Text=}

Configuration & Diagnostics

Get-PiHoleConfig

Get-PiHoleConfig -PiHoleServer $PiHoleServer -Password $Password

Dns       : @{Upstreams=System.Object[]; CNAMEdeepInspect=True; BlockESNI=True; EDNS0ECS=True; IgnoreLocalhost=False; ShowDNSSEC=True; AnalyzeOnlyAandAAAA=False; PiholePTR=PI.HOLE; ReplyWhenBusy=ALLOW; BlockTTL=2; Hosts=System.Object[]; DomainNeeded=False; ExpandHosts=False; BogusPriv=True; Dnssec=False; Interface=wlan0; HostRecord=; ListeningMode=LOCAL; QueryLogging=False; CnameRecords=; Port=53; Localise=True; RevServers=; Domain=; Cache=; Blocking=; SpecialDomains=; Reply=; RateLimit=}
Dhcp      : @{Active=False; Start=; End=; Router=; Netmask=; LeaseTime=; Ipv6=False; RapidCommit=False; MultiDNS=False; Logging=False; IgnoreUnknownClients=False; Hosts=}
Ntp       : @{Ipv4=; Ipv6=; Sync=}
Resolver  : @{ResolveIPv4=True; ResolveIPv6=True; MacNames=True; NetworkNames=True; RefreshNames=IPV4_ONLY}
Database  : @{DBimport=True; MaxDBdays=2; DBinterval=60; UseWAL=True; ForceDisk=False; Network=}
Webserver : @{Domain=pi.hole; Acl=; Port=8089,8489s; Threads=50; Headers=System.Object[]; ServeAll=False; AdvancedOpts=; Session=; Tls=; Paths=; Interface=; Api=}
Files     : @{Database=/etc/pihole/pihole-FTL.db; TmpDb=/etc/pihole/pihole-tmp.db; Gravity=/etc/pihole/gravity.db; GravityTmp=/tmp; Macvendor=/etc/pihole/macvendor.db; Pcap=; Log=}
Misc      : @{Privacylevel=0; DelayStartup=0; Nice=-10; Addr2line=True; EtcDnsmasqD=False; DnsmasqLines=; ExtraLogging=False; ReadOnly=False; NormalizeCPU=True; HideDnsmasqWarn=False; HideConnectionError=False; Check=}
Debug     : @{Database=False; Networking=False; Locks=False; Queries=False; Flags=False; Shmem=False; Gc=False; Arp=False; Regex=False; Api=False; Tls=False; Overtime=False; Status=False; Caps=False; Dnssec=False; Vectors=False; Resolver=False; Edns0=False; Clients=False; Aliasclients=False; Events=False; Helper=False; Config=False; Inotify=False; Webserver=False; Extra=False; Reserved=False; Ntp=False; Netlink=False; Timing=False; Performance=False; All=False}

Get-PiHoleConfigProperty

Get-PiHoleConfigProperty -PiHoleServer $PiHoleServer -Password $Password

Key         : webserver.advancedOpts
Reason      : read_only
Description : Variable can only be set in pihole.toml, through an environment variable or using pihole-FTL --config, not via API

Key         : webserver.paths.webroot
Reason      : read_only
Description : Variable can only be set in pihole.toml, through an environment variable or using pihole-FTL --config, not via API

Key         : webserver.paths.webhome
Reason      : read_only
Description : Variable can only be set in pihole.toml, through an environment variable or using pihole-FTL --config, not via API

Key         : webserver.paths.prefix
Reason      : read_only
Description : Variable can only be set in pihole.toml, through an environment variable or using pihole-FTL --config, not via API

Key         : misc.dnsmasq_lines
Reason      : read_only
Description : Variable can only be set in pihole.toml, through an environment variable or using pihole-FTL --config, not via API

_(showing 5 of 6 results)_

Set-PiHoleConfig

Set-PiHoleConfig -PiHoleServer $PiHoleServer -Password $Password -Settings @{ debug = @{ api = $true } }

Dns       : @{Upstreams=System.Object[]; CNAMEdeepInspect=True; BlockESNI=True; EDNS0ECS=True; IgnoreLocalhost=False; ShowDNSSEC=True; AnalyzeOnlyAandAAAA=False; PiholePTR=PI.HOLE; ReplyWhenBusy=ALLOW; BlockTTL=2; Hosts=System.Object[]; DomainNeeded=False; ExpandHosts=False; BogusPriv=True; Dnssec=False; Interface=wlan0; HostRecord=; ListeningMode=LOCAL; QueryLogging=False; CnameRecords=; Port=53; Localise=True; RevServers=; Domain=; Cache=; Blocking=; SpecialDomains=; Reply=; RateLimit=}
Dhcp      : @{Active=False; Start=; End=; Router=; Netmask=; LeaseTime=; Ipv6=False; RapidCommit=False; MultiDNS=False; Logging=False; IgnoreUnknownClients=False; Hosts=}
Ntp       : @{Ipv4=; Ipv6=; Sync=}
Resolver  : @{ResolveIPv4=True; ResolveIPv6=True; MacNames=True; NetworkNames=True; RefreshNames=IPV4_ONLY}
Database  : @{DBimport=True; MaxDBdays=2; DBinterval=60; UseWAL=True; ForceDisk=False; Network=}
Webserver : @{Domain=pi.hole; Acl=; Port=8089,8489s; Threads=50; Headers=System.Object[]; ServeAll=False; AdvancedOpts=; Session=; Tls=; Paths=; Interface=; Api=}
Files     : @{Database=/etc/pihole/pihole-FTL.db; TmpDb=/etc/pihole/pihole-tmp.db; Gravity=/etc/pihole/gravity.db; GravityTmp=/tmp; Macvendor=/etc/pihole/macvendor.db; Pcap=; Log=}
Misc      : @{Privacylevel=0; DelayStartup=0; Nice=-10; Addr2line=True; EtcDnsmasqD=False; DnsmasqLines=; ExtraLogging=False; ReadOnly=False; NormalizeCPU=True; HideDnsmasqWarn=False; HideConnectionError=False; Check=}
Debug     : @{Database=False; Networking=False; Locks=False; Queries=False; Flags=False; Shmem=False; Gc=False; Arp=False; Regex=False; Api=True; Tls=False; Overtime=False; Status=False; Caps=False; Dnssec=False; Vectors=False; Resolver=False; Edns0=False; Clients=False; Aliasclients=False; Events=False; Helper=False; Config=False; Inotify=False; Webserver=False; Extra=False; Reserved=False; Ntp=False; Netlink=False; Timing=False; Performance=False; All=False}

Add-PiHoleConfigArrayItem

Add-PiHoleConfigArrayItem -PiHoleServer $PiHoleServer -Password $Password -Element "dns/hosts" -Value "192.0.2.1 piholeshell-docs-example.com"

Element : dns/hosts
Value   : 192.0.2.1 piholeshell-docs-example.com
Status  : Added

Remove-PiHoleConfigArrayItem

Remove-PiHoleConfigArrayItem -PiHoleServer $PiHoleServer -Password $Password -Element "dns/hosts" -Value "192.0.2.1 piholeshell-docs-example.com"

Element : dns/hosts
Value   : 192.0.2.1 piholeshell-docs-example.com
Status  : Removed

Get-PiHolePadd

Get-PiHolePadd -PiHoleServer $PiHoleServer -Password $Password

CpuPercent    : 0
MemoryPercent : 0
ActiveClients : 2
Blocking      : enabled
Cache         : @{Size=10000; Inserted=34; Evicted=0}
Config        : @{DhcpActive=False; DhcpStart=; DhcpEnd=; DhcpIpv6=False; DnsDnssec=False; DnsDomain=lan; DnsNumUpstreams=2; DnsPort=53; DnsrevServerAactive=False; PrivacyLevel=0}
GravitySize   : 526957
HostModel     : Raspberry Pi Zero W Rev 1.1
IFace         : @{v4=; v6=}
NodeName      : dns3.localdomain
Pid           : 389
Queries       : @{Total=69; Blocked=8; PercentBlocked=11.5942029953003; QueryFrequency=0}
RecentBlocked : googlesyndication.com
Sensors       : @{CpuTemp=40.622; HotLimit=60; Unit=C}
System        : @{Uptime=384699; Memory=; Procs=70; Cpu=; Ftl=}
TopBlocked    : analytics.google.com
TopClient     : 192.168.1.162
TopDomain     : 1.0.0.127.in-addr.arpa
Version       : @{Core=; Web=; Ftl=; Docker=}

Get-PiHoleInfoHost

Get-PiHoleInfoHost -PiHoleServer $PiHoleServer -Password $Password

DomainName     : (none)
Machine        : armv6l
NodeName       : dns3.localdomain
Release        : 6.12.109+rpt-rpi-v6
SysName        : Linux
Version        : #1 Raspbian 1:6.12.109-1+rpt1 (2026-09-11)
Model          : Raspberry Pi Zero W Rev 1.1
BiosVendor     : 
BoardName      : 
BoardVendor    : 
BoardVersion   : 
ProductName    : 
ProductFamily  : 
ProductVersion : 
SysVendor      :

Get-PiHoleInfoSystem

Get-PiHoleInfoSystem -PiHoleServer $PiHoleServer -Password $Password

Uptime : 384709
Memory : @{Ram=; Swap=}
Procs  : 70
Cpu    : @{NumProcessors=1; PercentCpu=96.8000030517578; Load=}
Ftl    : @{PercentMemory=3.02243185043335; PercentCpu=96.5}

Get-PiHoleInfoFtl

Get-PiHoleInfoFtl -PiHoleServer $PiHoleServer -Password $Password

Database         : @{Gravity=526957; Antigravity=0; Groups=4; Lists=14; Clients=0; Domains=; Regex=}
PrivacyLevel     : 0
QueryFrequency   : 0
Clients          : @{Total=2; Active=2}
Pid              : 389
Uptime           : 528324.275473
PercentMemory    : 3.02243185043335
PercentCpu       : 96.5
AllowDestructive : True
Dnsmasq          : @{DnsCacheInserted=34; DnsCacheLiveFreed=0; DnsQueriesForwarded=25; DnsAuthAnswered=0; DnsLocalAnswered=15; DnsStaleAnswered=0; DnsUnanswered=0; DnssecMaxCryptoUse=0; DnssecMaxSigFail=0; DnssecMaxWork=0; Bootp=0; Pxe=0; DhcpAck=0; DhcpDecline=0; DhcpDiscover=0; DhcpInform=0; DhcpNak=0; DhcpOffer=0; DhcpRelease=0; DhcpRequest=0; Noanswer=0; LeasesAllocated4=0; LeasesPruned4=0; LeasesAllocated6=0; LeasesPruned6=0; TcpConnections=0; DhcpLeasequery=0; DhcpLeaseUnassigned=0; DhcpLeaseActve=0; DhcpLeaseUnknown=0}

Get-PiHoleInfoSensors

Get-PiHoleInfoSensors -PiHoleServer $PiHoleServer -Password $Password

List     : {@{Name=cpu_thermal; Path=hwmon0; Source=devices/virtual/thermal/thermal_zone0; Temps=}, @{Name=rpi_volt; Path=hwmon1; Source=devices/platform/soc/soc:firmware/raspberrypi-hwmon; Temps=}}
CpuTemp  : 41.16
HotLimit : 60
Unit     : C

Get-PiHoleInfoDatabase

Get-PiHoleInfoDatabase -PiHoleServer $PiHoleServer -Password $Password

Size                  : 13983744
Type                  : Regular file
Mode                  : rw-r-----
AccessTime            : 6/25/2025 12:32:44 AM
ModifiedTime          : 10/6/2026 9:56:20 PM
ChangeTime            : 10/6/2026 9:56:20 PM
Owner                 : @{User=; Group=}
Queries               : 69
EarliestTimestamp     : 10/5/2026 10:00:00 PM
QueriesDisk           : 391
EarliestTimestampDisk : 10/4/2026 2:31:09 PM
SqliteVersion         : 3.53.1

Get-PiHoleInfoVersion

Get-PiHoleInfoVersion -PiHoleServer $PiHoleServer -Password $Password

Core   : @{Local=; Remote=}
Web    : @{Local=; Remote=}
Ftl    : @{Local=; Remote=}
Docker : @{Local=; Remote=}

Get-PiHoleInfoMetrics

Get-PiHoleInfoMetrics -PiHoleServer $PiHoleServer -Password $Password

Dns  : @{Cache=; Replies=}
Dhcp : @{Ack=0; Nak=0; Decline=0; Offer=0; Discover=0; Inform=0; Request=0; Release=0; NoAnswer=0; Bootp=0; Pxe=0; Leases=}

Get-PiHoleInfoClient

Does not require -Password - the API does not authenticate this endpoint.

Get-PiHoleInfoClient -PiHoleServer $PiHoleServer

RemoteAddress : 192.168.1.162
HttpVersion   : 1.1
Method        : GET
Headers       : {@{Name=Host; Value=dns3.localdomain:8489}, @{Name=User-Agent; Value=Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6}, @{Name=Accept-Encoding; Value=gzip, deflate, br}, @{Name=Content-Type; Value=application/json}…}

Get-PiHoleInfoLogin

Does not require -Password - the API does not authenticate this endpoint (it is meant to be usable before logging in).

Get-PiHoleInfoLogin -PiHoleServer $PiHoleServer

HttpsPort : 8489
Dns       : True

Get-PiHoleInfoMessage

Get-PiHoleInfoMessage -PiHoleServer $PiHoleServer -Password $Password
(no output)

Get-PiHoleInfoMessageCount

Get-PiHoleInfoMessageCount -PiHoleServer $PiHoleServer -Password $Password

Count : 0

Remove-PiHoleInfoMessage

Diagnosis messages arise from real FTL warnings and cannot be manufactured on demand, so this example shows the error for a message ID that does not exist rather than a fabricated success.

Remove-PiHoleInfoMessage -PiHoleServer $PiHoleServer -Password $Password -MessageId 3

Error : Response status code does not indicate success: 404 (Not Found).

Get-PiHoleLogWebserver

Get-PiHoleLogWebserver -PiHoleServer $PiHoleServer -Password $Password

Log    : {@{Timestamp=10/6/2026 9:56:22 PM; Message=Initializing HTTP server on ports "8089,8489s"; Priority=}, @{Timestamp=10/6/2026 10:04:28 PM; Message=ACCESS: 192.168.1.162 - - [07/Oct/2026:03:04:27 +0000] "PATCH /api/config?restart=false HTTP/1.1" 200 4588 - Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6; Priority=}, @{Timestamp=10/6/2026 10:04:29 PM; Message=ACCESS: 192.168.1.162 - - [07/Oct/2026:03:04:28 +0000] "DELETE /api/auth HTTP/1.1" 204 558 - Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6; Priority=}, @{Timestamp=10/6/2026 10:04:33 PM; Message=ACCESS: 192.168.1.162 - - [07/Oct/2026:03:04:28 +0000] "POST /api/auth HTTP/1.1" 200 808 - Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6; Priority=}}
NextID : 4
Pid    : 389
File   : /var/log/pihole/webserver.log

Get-PiHoleLogDnsmasq

Get-PiHoleLogDnsmasq -PiHoleServer $PiHoleServer -Password $Password

Log    : {@{Timestamp=10/6/2026 9:56:22 PM; Message=started, version pi-hole-v2.93 cachesize 10000; Priority=}, @{Timestamp=10/6/2026 9:56:22 PM; Message=DNS service limited to local subnets; Priority=}, @{Timestamp=10/6/2026 9:56:22 PM; Message=compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n IDN2 DHCP DHCPv6 Lua TFTP no-conntrack ipset no-nftset auth DNSSEC loop-detect inotify dumpfile; Priority=}, @{Timestamp=10/6/2026 9:56:22 PM; Message=using nameserver 8.8.8.8#53; Priority=}…}
NextID : 21
Pid    : 389
File   : /var/log/pihole/pihole.log

Get-PiHoleLogFtl

Get-PiHoleLogFtl -PiHoleServer $PiHoleServer -Password $Password

Log    : {@{Timestamp=10/6/2026 9:56:21 PM; Message=PID of FTL process: 389; Priority=INFO}, @{Timestamp=10/6/2026 9:56:21 PM; Message=listening on 0.0.0.0 port 53; Priority=INFO}, @{Timestamp=10/6/2026 9:56:21 PM; Message=listening on :: port 53; Priority=INFO}, @{Timestamp=10/6/2026 9:56:21 PM; Message=Database version is 22; Priority=INFO}…}
NextID : 109
Pid    : 389
File   : /var/log/pihole/FTL.log

Get-PiHoleTeleporterDownload

FolderPath/FileName are yours to choose; the captured output below used a scratch temp folder for this run instead of C:\Backups.

Get-PiHoleTeleporterDownload -PiHoleServer $PiHoleServer -Password $Password -FolderPath "C:\Backups" -FileName "pihole-backup"

FileName   : pihole-backup.zip
FilePath   : C:\Users\mmadeja\AppData\Local\Temp\PiHoleShellDocsExample\pihole-backup.zip
RootFolder : C:\Users\mmadeja\AppData\Local\Temp\PiHoleShellDocsExample
FileSizeKB : 25

Import-PiHoleTeleporter

Prompts for confirmation by default since it can overwrite your whole configuration - pass -Confirm:$false to skip the prompt, or -WhatIf for a dry run. Omitting every item switch (as here, Group is just one example) imports everything in the archive instead of only the selected items.

Import-PiHoleTeleporter -PiHoleServer $PiHoleServer -Password $Password -FilePath "C:\Backups\pihole-backup.zip" -Group

Processed : {etc/pihole/gravity.db->group}

Get-PiHoleHistory

Get-PiHoleHistory -PiHoleServer $PiHoleServer -Password $Password

Timestamp : 10/5/2026 10:15:00 PM
Total     : 0
Cached    : 0
Blocked   : 0
Forwarded : 0

Timestamp : 10/5/2026 10:25:00 PM
Total     : 0
Cached    : 0
Blocked   : 0
Forwarded : 0

Timestamp : 10/5/2026 10:35:00 PM
Total     : 0
Cached    : 0
Blocked   : 0
Forwarded : 0

Timestamp : 10/5/2026 10:45:00 PM
Total     : 0
Cached    : 0
Blocked   : 0
Forwarded : 0

Timestamp : 10/5/2026 10:55:00 PM
Total     : 0
Cached    : 0
Blocked   : 0
Forwarded : 0

_(showing 5 of 145 results)_

Get-PiHoleHistoryClient

Get-PiHoleHistoryClient -PiHoleServer $PiHoleServer -Password $Password

Timestamp : 10/5/2026 10:15:00 PM
Clients   : {@{IP=127.0.0.1; Name=localhost; Count=0}, @{IP=192.168.1.162; Name=; Count=0}, @{IP=others; Name=; Count=0}}

Timestamp : 10/5/2026 10:25:00 PM
Clients   : {@{IP=127.0.0.1; Name=localhost; Count=0}, @{IP=192.168.1.162; Name=; Count=0}, @{IP=others; Name=; Count=0}}

Timestamp : 10/5/2026 10:35:00 PM
Clients   : {@{IP=127.0.0.1; Name=localhost; Count=0}, @{IP=192.168.1.162; Name=; Count=0}, @{IP=others; Name=; Count=0}}

Timestamp : 10/5/2026 10:45:00 PM
Clients   : {@{IP=127.0.0.1; Name=localhost; Count=0}, @{IP=192.168.1.162; Name=; Count=0}, @{IP=others; Name=; Count=0}}

Timestamp : 10/5/2026 10:55:00 PM
Clients   : {@{IP=127.0.0.1; Name=localhost; Count=0}, @{IP=192.168.1.162; Name=; Count=0}, @{IP=others; Name=; Count=0}}

_(showing 5 of 145 results)_

Get-PiHoleHistoryDatabase

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleHistoryDatabase -PiHoleServer $PiHoleServer -Password $Password

Timestamp : 10/6/2026 3:00:00 PM
Total     : 1
Cached    : 1
Blocked   : 0
Forwarded : 0

Timestamp : 10/6/2026 4:00:00 PM
Total     : 1
Cached    : 1
Blocked   : 0
Forwarded : 0

Timestamp : 10/6/2026 5:00:00 PM
Total     : 1
Cached    : 1
Blocked   : 0
Forwarded : 0

Timestamp : 10/6/2026 6:00:00 PM
Total     : 1
Cached    : 1
Blocked   : 0
Forwarded : 0

Timestamp : 10/6/2026 7:00:00 PM
Total     : 1
Cached    : 1
Blocked   : 0
Forwarded : 0

_(showing 5 of 10 results)_

Get-PiHoleHistoryDatabaseClient

Defaults to the last 8 hours; pass -From/-Until for a different window.

Get-PiHoleHistoryDatabaseClient -PiHoleServer $PiHoleServer -Password $Password

Timestamp : 10/6/2026 10:00:00 PM
Clients   : {@{ClientId=5; Count=1}, @{ClientId=3; Count=1}}

Timestamp : 10/6/2026 9:50:00 PM
Clients   : @{ClientId=3; Count=1}

Timestamp : 10/6/2026 9:40:00 PM
Clients   : @{ClientId=3; Count=1}

Timestamp : 10/6/2026 9:00:00 PM
Clients   : @{ClientId=3; Count=1}

Timestamp : 10/6/2026 8:00:00 PM
Clients   : @{ClientId=3; Count=1}

_(showing 5 of 10 results)_

Get-PiHoleNetworkGateway

Get-PiHoleNetworkGateway -PiHoleServer $PiHoleServer -Password $Password

Family    : inet
Interface : wlan0
Address   : 192.168.1.1
Local     : 192.168.1.248

Get-PiHoleNetworkRoute

Get-PiHoleNetworkRoute -PiHoleServer $PiHoleServer -Password $Password

Table    : 254
Family   : inet
Protocol : boot
Scope    : universe
Type     : unicast
Flags    : 
Gateway  : 192.168.1.1
Oif      : wlan0
Dst      : default

Table    : 254
Family   : inet
Protocol : kernel
Scope    : link
Type     : unicast
Flags    : 
Dst      : 192.168.1.0
Prefsrc  : 192.168.1.248
Oif      : wlan0

Table    : 255
Family   : inet
Protocol : kernel
Scope    : host
Type     : local
Flags    : 
Dst      : 127.0.0.0
Prefsrc  : 127.0.0.1
Oif      : lo

Table    : 255
Family   : inet
Protocol : kernel
Scope    : host
Type     : local
Flags    : 
Dst      : 127.0.0.1
Prefsrc  : 127.0.0.1
Oif      : lo

Table    : 255
Family   : inet
Protocol : kernel
Scope    : link
Type     : broadcast
Flags    : 
Dst      : 127.255.255.255
Prefsrc  : 127.0.0.1
Oif      : lo

_(showing 5 of 11 results)_

Get-PiHoleNetworkInterface

Get-PiHoleNetworkInterface -PiHoleServer $PiHoleServer -Password $Password

Name      : lo
Speed     : 
Type      : loopback
Flags     : {up, loopback, running, lower_up}
State     : unknown
Carrier   : True
ProtoDown : False
Address   : 00:00:00:00:00:00
Broadcast : 00:00:00:00:00:00
Stats     : @{RxBytes=; TxBytes=; Bits=64}
Addresses : {@{Family=inet; Scope=host; Flags=permanent; Prefixlen=8; Address=127.0.0.1; AddressType=loopback; Local=127.0.0.1; LocalType=loopback; Label=lo; Prefered=4294967295; Valid=4294967295; Cstamp=1790957600.02; Tstamp=1790957600.02}, @{Family=inet6; Scope=host; Flags=permanent; Prefixlen=128; Address=::1; AddressType=loopback; Prefered=4294967295; Valid=4294967295; Cstamp=1790957600.02; Tstamp=1790957600.02}}

Name        : wlan0
Speed       : 
Type        : ether
Flags       : {up, broadcast, running, multicast…}
State       : up
Carrier     : True
ProtoDown   : False
Address     : b8:27:eb:11:a4:d5
Broadcast   : ff:ff:ff:ff:ff:ff
PermAddress : b8:27:eb:11:a4:d5
Stats       : @{RxBytes=; TxBytes=; Bits=64}
Addresses   : {@{Family=inet; Scope=universe; Flags=; Prefixlen=24; Address=192.168.1.248; AddressType=private; Local=192.168.1.248; LocalType=private; Broadcast=192.168.1.255; BroadcastType=private; Label=wlan0; Prefered=62449; Valid=62449; Cstamp=1790957620.44; Tstamp=1791318773.93}, @{Family=inet6; Scope=link; Flags=permanent; Prefixlen=64; Address=fe80::ba27:ebff:fe11:a4d5; AddressType=link-local (LL); Prefered=4294967295; Valid=4294967295; Cstamp=1790957619.8; Tstamp=1790957619.8}}

Get-PiHoleNetworkDevice

Shows up to 10 devices by default; pass -MaxDevices for more.

Get-PiHoleNetworkDevice -PiHoleServer $PiHoleServer -Password $Password

Id         : 2
HwAddr     : ip-127.0.0.1
Interface  : lo
FirstSeen  : 10/4/2026 2:31:10 PM
LastQuery  : 10/6/2026 10:06:14 PM
NumQueries : 82
MacVendor  : 
Ips        : @{Ip=127.0.0.1; Name=localhost; LastSeen=10/6/2026 10:12:00 PM; NameUpdated=10/6/2026 10:12:00 PM}

Id         : 1
HwAddr     : 74:56:3c:bb:f4:0b
Interface  : wlan0
FirstSeen  : 10/4/2026 2:31:09 PM
LastQuery  : 10/6/2026 10:03:16 PM
NumQueries : 318
MacVendor  : Giga-Byte Technology Co.,Ltd.
Ips        : @{Ip=192.168.1.162; Name=; LastSeen=10/6/2026 10:12:00 PM; NameUpdated=12/31/1969 6:00:00 PM}

Remove-PiHoleNetworkDevice

Network devices arise from Pi-hole having genuinely seen a device and cannot be manufactured on demand, so this example shows the error for a device ID that does not exist rather than a fabricated success.

Remove-PiHoleNetworkDevice -PiHoleServer $PiHoleServer -Password $Password -DeviceId 5

Error : Response status code does not indicate success: 404 (Not Found).

Get-PiHoleDhcpLease

Get-PiHoleDhcpLease -PiHoleServer $PiHoleServer -Password $Password
(no output)

Remove-PiHoleDhcpLease

DHCP leases arise from Pi-hole genuinely handing one out and cannot be manufactured on demand, so this example shows the error for an IP address with no active lease rather than a fabricated success.

Remove-PiHoleDhcpLease -PiHoleServer $PiHoleServer -Password $Password -Ip "192.168.1.50"

Error : Response status code does not indicate success: 400 (Bad Request).

Authentication

Get-PiHoleAuthStatus

Password is optional - omit it to check whether your Pi-hole requires a login at all for this client, without authenticating. This test server does require login, so the result below is from a real authenticated check.

Get-PiHoleAuthStatus -PiHoleServer $PiHoleServer -Password $Password

Valid    : True
Totp     : False
Sid      : +dfslUHafhrdo0TwRT5nxQ=
Csrf     : Em6pqkbJ6cuWxjQw7EtUFw=
Validity : 1800
Message  : correct password

Get-PiHoleAuthTotp

Get-PiHoleAuthTotp -PiHoleServer $PiHoleServer -Password $Password

Type      : totp
Account   : pi.hole
Issuer    : Pi-hole%20API
Algorithm : SHA1
Digits    : 6
Period    : 30
Offset    : 0
Secret    : EG7DLOTZKTQWIRWBFR2JJLS5Q3BYNUN3
Codes     : {201435, 619358, 736784, 226002…}

Get-PiHoleCurrentAuthSession

Get-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Password $Password

Id             : 0
CurrentSession : False
Valid          : True
TlsLogin       : True
TlsMixed       : False
LoginAt        : 10/6/2026 9:44:13 PM
LastActive     : 10/6/2026 9:44:17 PM
ValidUntil     : 10/6/2026 10:14:17 PM
RemoteAddress  : 192.168.1.162
UserAgent      : Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6
XForwardedFor  : 
App            : True
Cli            : False

Id             : 1
CurrentSession : False
Valid          : True
TlsLogin       : True
TlsMixed       : False
LoginAt        : 10/6/2026 9:44:59 PM
LastActive     : 10/6/2026 9:44:59 PM
ValidUntil     : 10/6/2026 10:14:59 PM
RemoteAddress  : 192.168.1.162
UserAgent      : Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6
XForwardedFor  : 
App            : True
Cli            : False

Id             : 2
CurrentSession : True
Valid          : True
TlsLogin       : True
TlsMixed       : False
LoginAt        : 10/6/2026 10:03:33 PM
LastActive     : 10/6/2026 10:03:37 PM
ValidUntil     : 10/6/2026 10:33:37 PM
RemoteAddress  : 192.168.1.162
UserAgent      : Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.26200; en-US) PowerShell/7.6.6
XForwardedFor  : 
App            : True
Cli            : False

Remove-PiHoleAuthSession

Deletes a session by its ID (as shown by Get-PiHoleCurrentAuthSession), not the caller's own session.

Remove-PiHoleAuthSession -PiHoleServer $PiHoleServer -Password $Password -Id 2


Id     : 2
Status : Removed

Remove-PiHoleCurrentAuthSession

The internal best-effort logout every other function calls automatically when it finishes - it never produces output, even on failure (a warning only). Shown here for completeness since it is still a publicly exported function.

Remove-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Sid $Sid
(no output)