From 8b9296d0a8d8641f5bf74185876ba1bf409aaaa9 Mon Sep 17 00:00:00 2001 From: Thomas Parkison Date: Tue, 27 Aug 2024 14:05:21 -0400 Subject: [PATCH] Made it so that the script tells you that there's no update when there's no update when executing the script with the $checkForBWCliUpdate flag. --- Export-Bitwarden.psd1 | 2 +- Export-Bitwarden.psm1 | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Export-Bitwarden.psd1 b/Export-Bitwarden.psd1 index a03bf41..df96f42 100644 --- a/Export-Bitwarden.psd1 +++ b/Export-Bitwarden.psd1 @@ -12,7 +12,7 @@ RootModule = 'Export-Bitwarden.psm1' # Version number of this module. -ModuleVersion = '1.44' +ModuleVersion = '1.45' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/Export-Bitwarden.psm1 b/Export-Bitwarden.psm1 index 7e64db9..eb90118 100644 --- a/Export-Bitwarden.psm1 +++ b/Export-Bitwarden.psm1 @@ -32,7 +32,7 @@ function Export-Bitwarden { # Don't touch this line! # == WARNING!!! DO NOT TOUCH ANYTHING BELOW THIS!!! == # ==================================================== - $ver = "1.44" + $ver = "1.45" Write-Host -ForegroundColor Green "========================================================================================" Write-Host -ForegroundColor Green "== Bitwarden Vault Export Script v$ver ==" @@ -176,18 +176,23 @@ function Export-Bitwarden { # Don't touch this line! if (($checkForBWCliUpdate) -and (($forcebwcliupdate) -or (ShouldWeCheckForABWCLIUpdate))) { if ($forcebwcliupdate) { Write-Host -ForegroundColor Green "Notice:" -NoNewLine - Write-Host " Script executed with ForceBWCliUpdate flag." - Write-Host "" + Write-Host " Script executed with ForceBWCliUpdate flag." -NoNewLine } $localBWCliVersion = ((& $bwCliBinName --version) | Out-String).Trim() $remoteBWCliVersion = (Invoke-WebRequest -Uri "https://trparky.github.io/bwcliversion.txt").Content.Trim() if ($localBWCliVersion -ne $remoteBWCliVersion) { + Write-Host "" + Write-Host "" Write-Host "Bitwarden CLI application update found, downloading... Please Wait." -NoNewLine Remove-Item -Path $bwCliBinName DownloadBWCli } + else { + Write-Host " No update found." + Write-Host "" + } } }