How do I get this script to output just the URL portion test1.desktop.com
$SearchISS = {
$targetList = Get-PlatformTopology -environments $environment -IIS 1 -hostNameFilter $filter
param($target)
$sites = get-website
foreach ($site in $sites) {
$bindings = $site.bindings.Collection | Where-Object { $_.protocol -eq "https"} | Select-Object -ExpandProperty bindingInformation
foreach ($binding in $bindings) {
Write-Host $binding
}
}
foreach ($target in $targetList) {
$hostName = $target.HostName
Write-Host ''
$session = Get-PowershellLegacySession -ComputerName $hostName
Invoke-Command -Session $session -ScriptBlock $SearchIIS -ArgumentList $target
}```
that outputs:
```*:443:test1.desktop.com
*:443:test2.desktop2.com```