From 6a1193a6b552cf4f7b75f4152e02dfc1fa67287d Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Mon, 13 Jul 2026 13:42:05 -0400 Subject: [PATCH 1/4] refactor: replace [string]::IsNullOrEmpty with -not in Azure storage cmdlets (#870) --- d365fo.tools/functions/get-d365azurestoragefile.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/functions/get-d365azurestoragefile.ps1 b/d365fo.tools/functions/get-d365azurestoragefile.ps1 index e20ca8e8..ae2aeff0 100644 --- a/d365fo.tools/functions/get-d365azurestoragefile.ps1 +++ b/d365fo.tools/functions/get-d365azurestoragefile.ps1 @@ -90,7 +90,7 @@ function Get-D365AzureStorageFile { Invoke-TimeSignal -Start - if ([string]::IsNullOrEmpty($SAS)) { + if (-not $SAS) { Write-PSFMessage -Level Verbose -Message "Working against Azure Storage Account with AccessToken" $storageContext = New-AzStorageContext -StorageAccountName $AccountId.ToLower() -StorageAccountKey $AccessToken @@ -127,4 +127,4 @@ function Get-D365AzureStorageFile { } Invoke-TimeSignal -End -} \ No newline at end of file +} From 49a60da638b517a1455fa96161341926e93992b4 Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Mon, 13 Jul 2026 13:43:35 -0400 Subject: [PATCH 2/4] refactor: replace [string]::IsNullOrEmpty with -not in Get-D365AzureStorageUrl (#870) --- d365fo.tools/functions/get-d365azurestorageurl.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d365fo.tools/functions/get-d365azurestorageurl.ps1 b/d365fo.tools/functions/get-d365azurestorageurl.ps1 index 2827e948..a52d13fc 100644 --- a/d365fo.tools/functions/get-d365azurestorageurl.ps1 +++ b/d365fo.tools/functions/get-d365azurestorageurl.ps1 @@ -71,9 +71,9 @@ function Get-D365AzureStorageUrl { [switch] $OutputAsHashtable ) - if (([string]::IsNullOrEmpty($AccountId) -eq $true) -or - ([string]::IsNullOrEmpty($Container)) -or - ([string]::IsNullOrEmpty($SAS))) { + if ((-not $AccountId) -or + (-not $Container) -or + (-not $SAS)) { Write-PSFMessage -Level Host -Message "It seems that you are missing some of the parameters. Please make sure that you either supplied them or have the right configuration saved." Stop-PSFFunction -Message "Stopping because of missing parameters" return @@ -97,4 +97,4 @@ function Get-D365AzureStorageUrl { } Invoke-TimeSignal -End -} \ No newline at end of file +} From 320e95d48d0ade7cf681bbae4a14be05941c519c Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Mon, 13 Jul 2026 13:44:25 -0400 Subject: [PATCH 3/4] refactor: replace [string]::IsNullOrEmpty with -not in Invoke-D365AzureStorageDownload (#870) --- .../functions/invoke-d365azurestoragedownload.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/d365fo.tools/functions/invoke-d365azurestoragedownload.ps1 b/d365fo.tools/functions/invoke-d365azurestoragedownload.ps1 index 9f41522e..b064c64b 100644 --- a/d365fo.tools/functions/invoke-d365azurestoragedownload.ps1 +++ b/d365fo.tools/functions/invoke-d365azurestoragedownload.ps1 @@ -114,9 +114,9 @@ function Invoke-D365AzureStorageDownload { return } - if (([string]::IsNullOrEmpty($AccountId) -eq $true) -or - ([string]::IsNullOrEmpty($Container)) -or - (([string]::IsNullOrEmpty($AccessToken)) -and ([string]::IsNullOrEmpty($SAS)))) { + if ((-not $AccountId) -or + (-not $Container) -or + ((-not $AccessToken) -and (-not $SAS))) { Write-PSFMessage -Level Host -Message "It seems that you are missing some of the parameters. Please make sure that you either supplied them or have the right configuration saved." Stop-PSFFunction -Message "Stopping because of missing parameters" return @@ -129,7 +129,7 @@ function Invoke-D365AzureStorageDownload { try { - if ([string]::IsNullOrEmpty($SAS)) { + if (-not $SAS) { Write-PSFMessage -Level Verbose -Message "Working against Azure Storage Account with AccessToken" $storageContext = New-AzStorageContext -StorageAccountName $AccountId.ToLower() -StorageAccountKey $AccessToken @@ -179,4 +179,4 @@ function Invoke-D365AzureStorageDownload { } END { } -} \ No newline at end of file +} From 91220d849d8109653d661bd2a64488e0c5c3740c Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Mon, 13 Jul 2026 13:45:46 -0400 Subject: [PATCH 4/4] refactor: replace [string]::IsNullOrEmpty with -not in Invoke-D365AzureStorageUpload (#870) --- .../functions/invoke-d365azurestorageupload.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/d365fo.tools/functions/invoke-d365azurestorageupload.ps1 b/d365fo.tools/functions/invoke-d365azurestorageupload.ps1 index 5bfe6dd3..6d6c1643 100644 --- a/d365fo.tools/functions/invoke-d365azurestorageupload.ps1 +++ b/d365fo.tools/functions/invoke-d365azurestorageupload.ps1 @@ -105,9 +105,9 @@ function Invoke-D365AzureStorageUpload { [switch] $EnableException ) BEGIN { - if (([string]::IsNullOrEmpty($AccountId) -eq $true) -or - ([string]::IsNullOrEmpty($Container)) -or - (([string]::IsNullOrEmpty($AccessToken)) -and ([string]::IsNullOrEmpty($SAS)))) { + if ((-not $AccountId) -or + (-not $Container) -or + ((-not $AccessToken) -and (-not $SAS))) { Write-PSFMessage -Level Host -Message "It seems that you are missing some of the parameters. Please make sure that you either supplied them or have the right configuration saved." Stop-PSFFunction -Message "Stopping because of missing parameters" return @@ -121,7 +121,7 @@ function Invoke-D365AzureStorageUpload { $FileName = Split-Path -Path $Filepath -Leaf try { - if ([string]::IsNullOrEmpty($SAS)) { + if (-not $SAS) { Write-PSFMessage -Level Verbose -Message "Working against Azure Storage Account with AccessToken" $storageContext = New-AzStorageContext -StorageAccountName $AccountId.ToLower() -StorageAccountKey $AccessToken @@ -136,7 +136,7 @@ function Invoke-D365AzureStorageUpload { Write-PSFMessage -Level Verbose -Message "Start uploading the file to Azure" - if ([string]::IsNullOrEmpty($ContentType)) { + if (-not $ContentType) { $ContentType = [System.Web.MimeMapping]::GetMimeMapping($Filepath) # Available since .NET4.5, so it can be used with PowerShell 5.0 and higher. Write-PSFMessage -Level Verbose -Message "Content Type is automatically set to value: $ContentType" @@ -165,4 +165,4 @@ function Invoke-D365AzureStorageUpload { } END { } -} \ No newline at end of file +}