Skip to content

Commit

Permalink
add info for using modules in Azure Devops pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyWei committed Jun 15, 2021
1 parent d96e7da commit 694876e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/using-in-azure-devops-pipeline.md
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
```

0 comments on commit 694876e

Please sign in to comment.