Skip to content

Commit ecdfe70

Browse files
authored
add info for using modules in Azure Devops pipeline (#89)
1 parent d96e7da commit ecdfe70

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Using In Azure Devops
2+
3+
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.
4+
5+
```
6+
Unregister-PSRepository -Name local -ErrorAction SilentlyContinue
7+
$psrepo="$env:systemdrive\psrepo"
8+
New-Item -Path $psrepo -ItemType Directory -force
9+
Invoke-WebRequest -Uri <URI_TO_AZ_ACCOUNTS_DOWNLOAD> -OutFile <AZ_ACCOUNTS_MODULE_DOWNLOADED_FILE>
10+
Invoke-WebRequest -Uri <URI_TO_AZ_RESOURCES_DOWNLOAD> -OutFile <AZ_RESOURCES_MODULE_DOWNLOADED_FILE>
11+
Register-PSRepository -Name local -SourceLocation $psrepo -InstallationPolicy Trusted
12+
Install-Module Az.Accounts -Repository Local
13+
Install-Module Az.Resources -Repository Local
14+
Import-Module Az.Accounts
15+
Import-Module Az.Resources
16+
```

0 commit comments

Comments
 (0)