From 8a5a2d77728ce846d340a17e8faff1cd75ce17f7 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 11 Jun 2020 21:08:40 +0000 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools repository --- .../TestResources/New-TestResources.ps1.md | 17 +++++++++++++++++ eng/common/TestResources/README.md | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/eng/common/TestResources/New-TestResources.ps1.md b/eng/common/TestResources/New-TestResources.ps1.md index 39efc1446258..c9a462aae3a8 100644 --- a/eng/common/TestResources/New-TestResources.ps1.md +++ b/eng/common/TestResources/New-TestResources.ps1.md @@ -412,6 +412,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -OutFile +save test environment settings into a test-resources.json.env file next to test-resources.json. +The file is protected via DPAPI. The environment file would be scoped to the current repository directory. +Note: Supported only on Windows. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/eng/common/TestResources/README.md b/eng/common/TestResources/README.md index 89e61a4cb07d..3c0cd7c2207e 100644 --- a/eng/common/TestResources/README.md +++ b/eng/common/TestResources/README.md @@ -35,6 +35,12 @@ eng\common\TestResources\New-TestResources.ps1 ` -TestApplicationSecret (ConvertFrom-SecureString $sp.Secret -AsPlainText) ``` +If you are running this for a .NET project on Windows, the recommended method is to +add the `-OutFile` switch to the above command. This will save test environment settings +into a test-resources.json.env file next to test-resources.json. The file is protected via DPAPI. +The environment file would be scoped to the current repository directory and avoids the need to +set environment variables or restart your IDE to recognize them. + Along with some log messages, this will output environment variables based on your current shell like in the following example: