Skip to content

Commit 832ca0e

Browse files
authored
[DataFactory]improve documentation for cmdlet New-AzDataFactoryV2LinkedServiceEncryptedCredential (#13356)
* improve documentation for cmdlet New-AzDataFactoryV2LinkedServiceEncryptedCredential * Improve error message of a command
1 parent 7253471 commit 832ca0e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/DataFactory/DataFactoryV2/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Improved error message of `New-AzDataFactoryV2LinkedServiceEncryptedCredential` command
2122

2223
## Version 1.11.0
2324
* Updated ADF .Net SDK version to 4.12.0

src/DataFactory/DataFactoryV2/LinkedServices/NewAzureDataFactoryLinkedServiceEncryptedCredentialCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,15 @@ public class NewAzureDataFactoryLinkedServiceEncryptedCredentialCommand : DataFa
4242
[Parameter(Mandatory = false, HelpMessage = Constants.HelpDontAskConfirmation)]
4343
public SwitchParameter Force { get; set; }
4444

45+
private static readonly Version supportedPSVersion = new Version(7, 0);
46+
4547
public override void ExecuteCmdlet()
4648
{
49+
if (Host.Version < supportedPSVersion)
50+
{
51+
throw new PSNotSupportedException($"PowerShell {supportedPSVersion} or higher is required");
52+
}
53+
4754
ByFactoryObject();
4855

4956
// ValidationNotNullOrEmpty doesn't handle whitespaces well

src/DataFactory/DataFactoryV2/help/New-AzDataFactoryV2LinkedServiceEncryptedCredential.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ New-AzDataFactoryV2LinkedServiceEncryptedCredential [-IntegrationRuntimeName] <S
2929
## DESCRIPTION
3030
The New-AzDataFactoryV2LinkedServiceEncryptedCredential cmdlet encrypt credential in linked service with specified integration runtime.
3131

32+
Please ensure the following prerequisites are met:
33+
* **Remote access** option is enabled on the self-hosted integration runtime.
34+
* Powershell 7.0 or higher is used to execute the cmdlet.
35+
3236
## EXAMPLES
3337

3438
### Example 1: Encrypt credentials in a linked service

0 commit comments

Comments
 (0)