@@ -23,7 +23,7 @@ Get-PiHoleStatsRecentBlocked -PiHoleServer "http://pihole.domain.com:8080" -Pass
2323 [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingPlainTextForPassword" , " Password" )]
2424 param (
2525 [Parameter (Mandatory = $true )]
26- [string ]$PiHoleServer ,
26+ [System.URI ]$PiHoleServer ,
2727 [Parameter (Mandatory = $true )]
2828 [string ]$Password ,
2929 [int ]$MaxResult = 1 ,
@@ -35,7 +35,7 @@ Get-PiHoleStatsRecentBlocked -PiHoleServer "http://pihole.domain.com:8080" -Pass
3535 Write-Verbose - Message " MaxResults - $MaxResult "
3636 $Params = @ {
3737 Headers = @ {sid = $ ($Sid ) }
38- Uri = " $PiHoleServer /api/stats/recent_blocked?count=$MaxResult "
38+ Uri = " $ ( $ PiHoleServer.OriginalString ) /api/stats/recent_blocked?count=$MaxResult "
3939 Method = " Get"
4040 SkipCertificateCheck = $IgnoreSsl
4141 ContentType = " application/json"
@@ -81,7 +81,7 @@ https://TODOFINDNEWAPILINK
8181 [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingPlainTextForPassword" , " Password" )]
8282 param (
8383 [Parameter (Mandatory = $true )]
84- [string ]$PiHoleServer ,
84+ [System.URI ]$PiHoleServer ,
8585 [Parameter (Mandatory = $true )]
8686 [string ]$Password ,
8787 [bool ]$IgnoreSsl = $false ,
@@ -92,7 +92,7 @@ https://TODOFINDNEWAPILINK
9292 Write-Verbose - Message " MaxResults - $MaxResult "
9393 $Params = @ {
9494 Headers = @ {sid = $ ($Sid ) }
95- Uri = " $PiHoleServer /api/stats/query_types"
95+ Uri = " $ ( $ PiHoleServer.OriginalString ) /api/stats/query_types"
9696 Method = " Get"
9797 SkipCertificateCheck = $IgnoreSsl
9898 ContentType = " application/json"
@@ -136,7 +136,7 @@ https://TODOFINDNEWAPILINK
136136 [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingPlainTextForPassword" , " Password" )]
137137 param (
138138 [Parameter (Mandatory = $true )]
139- [string ]$PiHoleServer ,
139+ [System.URI ]$PiHoleServer ,
140140 [Parameter (Mandatory = $true )]
141141 [string ]$Password ,
142142 [int ]$MaxResult = 10 ,
@@ -162,7 +162,7 @@ https://TODOFINDNEWAPILINK
162162
163163 $Params = @ {
164164 Headers = @ {sid = $ ($Sid ) }
165- Uri = " $PiHoleServer /api/stats/top_domains?blocked=$Blocked &count=$MaxResult "
165+ Uri = " $ ( $ PiHoleServer.OriginalString ) /api/stats/top_domains?blocked=$Blocked &count=$MaxResult "
166166 Method = " Get"
167167 SkipCertificateCheck = $IgnoreSsl
168168 ContentType = " application/json"
@@ -191,7 +191,7 @@ The URL to the PiHole Server, for example "http://pihole.domain.com:8080", or "h
191191. PARAMETER Password
192192The API Password you generated from your PiHole server
193193
194- . PARAMETER IgnoreSsl
194+
195195This will dump the response instead of the formatted object
196196
197197. PARAMETER RawOutput
@@ -204,7 +204,7 @@ Get-PiHoleStatsSummary -PiHoleServer "http://pihole.domain.com:8080" -Password "
204204 [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingPlainTextForPassword" , " Password" )]
205205 param (
206206 [Parameter (Mandatory = $true )]
207- [string ]$PiHoleServer ,
207+ [System.URI ]$PiHoleServer ,
208208 [Parameter (Mandatory = $true )]
209209 [string ]$Password ,
210210 [bool ]$IgnoreSsl = $false ,
@@ -215,7 +215,7 @@ Get-PiHoleStatsSummary -PiHoleServer "http://pihole.domain.com:8080" -Password "
215215
216216 $Params = @ {
217217 Headers = @ {sid = $ ($Sid ) }
218- Uri = " $PiHoleServer /api/stats/summary"
218+ Uri = " $ ( $ PiHoleServer.OriginalString ) /api/stats/summary"
219219 Method = " Get"
220220 SkipCertificateCheck = $IgnoreSsl
221221 ContentType = " application/json"
0 commit comments