You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message:$"Microsoft.PowerShell.SecretManagement\\Get-Secret encountered an error while reading secret '{repositoryCredentialInfo.SecretName}' from vault '{repositoryCredentialInfo.VaultName}' for PSResourceRepository '{repositoryName}' authentication."),
newPSNotSupportedException($"Secret '{repositoryCredentialInfo.SecretName}' from vault '{repositoryCredentialInfo.VaultName}' has an invalid type. The only supported type is PSCredential."),
606
+
"RepositoryCredentialInvalidSecretType",
607
+
ErrorCategory.InvalidType,
608
+
cmdletPassedIn));
609
+
610
+
returnnull;
611
+
}
612
+
}
613
+
catch(Exceptione)
549
614
{
550
615
cmdletPassedIn.ThrowTerminatingError(
551
616
newErrorRecord(
552
617
newPSInvalidOperationException(
553
-
message:$"Microsoft.PowerShell.SecretManagement\\Get-Secret encountered an error while reading secret \"{repositoryCredentialInfo.SecretName}\" from vault \"{repositoryCredentialInfo.VaultName}\" for PSResourceRepository ({repositoryName}) authentication.",
554
-
innerException:terminatingError),
618
+
message:$"Microsoft.PowerShell.SecretManagement\\Get-Secret encountered an error while reading secret '{repositoryCredentialInfo.SecretName}' from vault '{repositoryCredentialInfo.VaultName}' for PSResourceRepository '{repositoryName}' authentication.",
619
+
innerException:e),
555
620
"RepositoryCredentialCannotGetSecretFromVault",
556
621
ErrorCategory.InvalidOperation,
557
622
cmdletPassedIn));
623
+
624
+
returnnull;
558
625
}
559
-
560
-
if(secretValueisPSCredentialsecretCredential)
561
-
{
562
-
returnsecretCredential;
563
-
}
564
-
565
-
cmdletPassedIn.ThrowTerminatingError(
566
-
newErrorRecord(
567
-
newPSNotSupportedException($"Secret \"{repositoryCredentialInfo.SecretName}\" from vault \"{repositoryCredentialInfo.VaultName}\" has an invalid type. The only supported type is PSCredential."),
message:$"Microsoft.PowerShell.SecretManagement\\Set-Secret encountered an error while adding secret \"{repositoryCredentialInfo.SecretName}\" to vault \"{repositoryCredentialInfo.VaultName}\" for PSResourceRepository ({repositoryName}) authentication.",
614
-
innerException:terminatingError),
701
+
message:$"Microsoft.PowerShell.SecretManagement\\Set-Secret encountered an error while adding secret '{repositoryCredentialInfo.SecretName}' to vault '{repositoryCredentialInfo.VaultName}' for PSResourceRepository '{repositoryName}' authentication.",
702
+
innerException:e),
615
703
"RepositoryCredentialCannotAddSecretToVault",
616
704
ErrorCategory.InvalidOperation,
617
705
cmdletPassedIn));
@@ -622,71 +710,115 @@ public static bool IsSecretManagementModuleAvailable(
message:$"Microsoft.PowerShell.SecretManagement\\Test-SecretVault encountered an error while validating the vault \"{repositoryCredentialInfo.VaultName}\" for PSResourceRepository ({repositoryName}) authentication.",
682
-
innerException:terminatingError),
814
+
message:$"Microsoft.PowerShell.SecretManagement\\Test-SecretVault encountered an error while validating the vault '{repositoryCredentialInfo.VaultName}' for PSResourceRepository '{repositoryName}' authentication.",
0 commit comments