add: Get-CISSpoOutput function and updated respective tests

This commit is contained in:
DrIOS
2024-06-23 16:06:31 -05:00
parent 4dd65a0140
commit bad103f0cf
16 changed files with 218 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
<#
.SYNOPSIS
This is a sample Private function only visible within the module.
.DESCRIPTION
This sample function is not exported to the module and only return the data passed as parameter.
.EXAMPLE
$null = Get-UrlLine -PrivateData 'NOTHING TO SEE HERE'
.PARAMETER PrivateData
The PrivateData parameter is what will be returned without transformation.
#>
function Get-UrlLine {
[cmdletBinding()]
[OutputType([string])]
param (
[Parameter(Mandatory=$true)]
[string]$Output
)
# Split the output into lines
$Lines = $Output -split "`n"
# Iterate over each line
foreach ($Line in $Lines) {
# If the line starts with 'https', return it
if ($Line.StartsWith('https')) {
return $Line.Trim()
}
}
# If no line starts with 'https', return an empty string
return $null
}