From 35a6cac71a8bac1891eaed91ee86c7368f9c7435 Mon Sep 17 00:00:00 2001 From: Maxime Kjaer Date: Mon, 17 Apr 2023 16:43:22 -0700 Subject: [PATCH] Fix error messages (#140) --- AzFilesHybrid/AzFilesHybrid.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AzFilesHybrid/AzFilesHybrid.psm1 b/AzFilesHybrid/AzFilesHybrid.psm1 index 6d10ca60..c3e89bd4 100644 --- a/AzFilesHybrid/AzFilesHybrid.psm1 +++ b/AzFilesHybrid/AzFilesHybrid.psm1 @@ -259,7 +259,7 @@ function Assert-IsNativeAD { if ("AD" -ne $DirectoryServiceOptions) { Write-Error -ErrorAction Stop -Message ( - "The cmdlet is stopped due to the storage account '$StorageAccountName' having the DirectoryServiceOptions value: '$DirectoryServiceOptions'. " + + "The cmdlet is stopped due to the storage account '$($StorageAccount.StorageAccountName)' having the DirectoryServiceOptions value: '$DirectoryServiceOptions'. " + "The DirectoryServiceOptions for the account needs to be 'AD' in order to run the cmdlet." ) } @@ -309,7 +309,7 @@ function Assert-IsUnconfiguredOrNativeAD { ) { Write-Error -ErrorAction Stop -Message ( - "The cmdlet is stopped due to the storage account '$StorageAccountName' having the DirectoryServiceOptions value: '$DirectoryServiceOptions'. " + + "The cmdlet is stopped due to the storage account '$($StorageAccount.StorageAccountName)' having the DirectoryServiceOptions value: '$DirectoryServiceOptions'. " + "The DirectoryServiceOptions for the account needs to be 'AD', 'None' or null in order to run the cmdlet." ) }