< Back

Import-AzureArtifactsModule

Sat Jan 11, 2020 10:10 am

NAME Import-AzureArtifactsModule



SYNOPSIS

Install (if necessary) and import a module from the specified repository.





SYNTAX

Import-AzureArtifactsModule [-Name] <String> [-Version <String>] [-AllowPrerelease] [-RepositoryName <String>]

[-Credential <PSCredential>] [-Force] [-Scope <String>] [<CommonParameters>]





DESCRIPTION

Install (if necessary) and import a module from the specified repository.





PARAMETERS

-Name <String>



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Version <String>



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-AllowPrerelease [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-RepositoryName <String>



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Credential <PSCredential>



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Scope <String>



Required? false

Position? named

Default value CurrentUser

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Name: (Required) The name of the PowerShell module to install (if necessary) and import.



Version: The specific version of the PowerShell module to install (if necessary) and import. If not provided, the

latest version will be used.



AllowPrerelease: If provided, prerelease versions are allowed to be installed and imported. This must be provided

if specifying a Prerelease version in the Version parameter.



RepositoryName: (Required) The name to use for the PSRepository that contains the module to import. This should be

obtained from the Register-AzureArtifactsPSRepository cmdlet.



Credential: The credential to use to connect to the Azure Artifacts feed.



Force: If provided, the specified PowerShell module will always be downloaded and installed, even if the version

is already installed.



Scope: If the PowerShell Module needs to be installed, this is the scope it will be installed in. Allowed values

are "AllUsers" and "CurrentUser". Default is "CurrentUser".





OUTPUTS

No outputs are returned.





NOTES





If a Credential is not provided, it will attempt to retrieve a PAT from the environment variables, as per

https://github.com/Microsoft/artifacts- ... -variables



This function writes to the error, warning, and information streams in different scenarios, as well as may

throw exceptions for catastrophic errors.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>```



Import-AzureArtifactsModule -Name 'ModuleNameInYourFeed' -RepositoryName $repositoryName

```

Installs the 'ModuleNameInYourFeed' module from the specified Repository if necessary, and then imports it.











RELATED LINKS