-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add info for using modules in Azure Devops pipeline
- Loading branch information
1 parent
d96e7da
commit 694876e
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Using In Azure Devops | ||
|
||
The recommended way to test newly generated Azurestack modules in Azure Devops is to upload them to a storage accessible by your Azure Devops pipeline. For example, the following code downloads, installs, and imports the required Az.Accounts and Az.Resources modules. | ||
|
||
``` | ||
Unregister-PSRepository -Name local -ErrorAction SilentlyContinue | ||
$psrepo="$env:systemdrive\psrepo" | ||
New-Item -Path $psrepo -ItemType Directory -force | ||
Invoke-WebRequest -Uri <URI_TO_AZ_ACCOUNTS_DOWNLOAD> -OutFile <AZ_ACCOUNTS_MODULE_DOWNLOADED_FILE> | ||
Invoke-WebRequest -Uri <URI_TO_AZ_RESOURCES_DOWNLOAD> -OutFile <AZ_RESOURCES_MODULE_DOWNLOADED_FILE> | ||
Register-PSRepository -Name local -SourceLocation $psrepo -InstallationPolicy Trusted | ||
Install-Module Az.Accounts -Repository Local | ||
Install-Module Az.Resources -Repository Local | ||
Import-Module Az.Accounts | ||
Import-Module Az.Resources | ||
``` |