Skip to content

Commit

Permalink
Change to Write-Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jayrodksmith authored Mar 11, 2024
1 parent 03ee2eb commit 8e0f1e5
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions Private/Helpers/Get-WebDriver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ function Get-WebDriver {
if (-not (Test-Path -Path $webDriversPath -PathType Container)) {
# Directory doesn't exist, create it
New-Item -Path $webDriversPath -ItemType Directory -Force | Out-Null
Write-Verbose "Directory created successfully."
Write-Debug "Directory created successfully."
} else {
Write-Verbose "Directory already exists."
Write-Debug "Directory already exists."
}
} catch {
Write-Host "An error occurred: $_"
Expand Down Expand Up @@ -106,7 +106,7 @@ function Get-WebDriver {
try {
Invoke-WebRequest $downloadLink -OutFile "$webDriversPath\chromeNewDriver.zip"
}catch{
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
}
# Expand archive and replace the old file
Expand-Archive "$webDriversPath\chromeNewDriver.zip" -DestinationPath "$webDriversPath\tempchrome" -Force
Expand All @@ -122,7 +122,7 @@ function Get-WebDriver {
try {
$edgeVersion = (Get-Item (Get-ItemProperty $edgeRegistryPath).'(Default)').VersionInfo.ProductVersion
} catch {
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
}
# check which driver versions are installed
$edgeDriverVersion = Get-LocalDriverVersion -pathToDriver $edgeDriverPath
Expand Down Expand Up @@ -150,7 +150,7 @@ function Get-WebDriver {
try {
Invoke-WebRequest $downloadLink -OutFile "$webDriversPath\edgeNewDriver.zip"
} catch{
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
}

# epand archive and replace the old file
Expand Down
6 changes: 3 additions & 3 deletions Private/Helpers/Start-SeleniumModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ function Start-SeleniumModule {
return $driver
}
$invokeasuser = invoke-ascurrentuser -scriptblock $scriptblock -UseWindowsPowerShell -CaptureOutput
Write-Verbose "Driver Invoked : $invokeasuser"
Write-Debug "Driver Invoked : $invokeasuser"
$process = "msedgedriver.exe"
$commandLine = Get-CimInstance Win32_Process -Filter "name = '$process'" | select CommandLine
Write-Verbose "msedgedriver.exe process : $commandLine"
Write-Debug "msedgedriver.exe process : $commandLine"
# Regular expression pattern to match port number
$portPattern = '--port=(\d+)'
if ($commandLine -match $portPattern) {
$driverportnumber = $matches[1]
Write-Verbose "Driver Port Number : $driverportnumber"
Write-Debug "Driver Port Number : $driverportnumber"
} else {
Write-Output "Port number not found."
}
Expand Down
4 changes: 2 additions & 2 deletions Private/Helpers/Test-SoftwareInstalled.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ foreach ($path in $registryPaths) {
$installed = Get-ItemProperty -Path $path | Where-Object { $_.DisplayName -eq $SoftwareName }
if ($installed) {
$version = $installed.DisplayVersion
Write-Verbose "$SoftwareName version $version is installed."
Write-Debug "$SoftwareName version $version is installed."
$result = [PSCustomObject]@{
Software = $SoftwareName
Installed = $true
Expand All @@ -41,7 +41,7 @@ Write-Host "WARNING"
Write-Host "$SoftwareName not detected"
Write-Host "This manufacturer currently requires $SoftwareName installed to check expiry"
Write-Host "###########################"
Write-Verbose "$SoftwareName is not installed."
Write-Debug "$SoftwareName is not installed."
$result = [PSCustomObject]@{
Software = $SoftwareName
Installed = $false
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-Warranty.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Get-Warranty {
# Enable Registry Storing
[Parameter(Mandatory = $false, ParameterSetName = 'Default')]
[bool]$EnableRegistry = $true,

# Registry Path
[Parameter(Mandatory = $false, ParameterSetName = 'Default')]
[String]$RegistryPath = 'HKLM:\SOFTWARE\RMMCustomInfo\',
Expand Down
4 changes: 2 additions & 2 deletions Public/Get-WarrantyAsus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Get-WarrantyAsus {
try{
$driver = Start-SeleniumModule -WebDriver $Seleniumdrivermode -Headless $true
}catch{
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
$WarObj = [PSCustomObject]@{
'Serial' = $Serial
'Warranty Product name' = $null
Expand All @@ -80,7 +80,7 @@ function Get-WarrantyAsus {
$submitcheckcookiesButton = $driver.FindElementByXPath("//div[@class='btn-asus btn-ok btn-read-ck' and @aria-label='Accept']")
$submitcheckcookiesButton.Click()
} catch{
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
}
$checkPrivacyButton = $driver.FindElementById("checkPrivacy")
$checkPrivacyButton.Click()
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-WarrantyDell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Get-WarrantyDell {
try{
$driver = Start-SeleniumModule -WebDriver $Seleniumdrivermode -Headless $true
}catch{
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
$WarObj = [PSCustomObject]@{
'Serial' = $Serial
'Warranty Product name' = $null
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-WarrantyEdsys.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Get-WarrantyEdsys {
try {
$response = Invoke-WebRequest -Uri $url -Method Post -Body $payload -ContentType "application/x-www-form-urlencoded" -UseBasicParsing
}catch{
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
}
if($response){
# Output the response
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-WarrantyHP.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Get-WarrantyHP {
}
catch {
if ($PSCmdlet.ParameterSetName -eq 'Default') {
Write-Verbose $_.Exception.Message
Write-Debug $_.Exception.Message
Write-Host "###########################"
Write-Host "WARNING"
Write-Host "$($browserinstalled.software) not detected"
Expand Down

0 comments on commit 8e0f1e5

Please sign in to comment.