Skip to content

PascalHaag/PSGetInternal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSGetInternal

Welcome to the module toolkit designed to work easily with internal repository. If you work with internal repositories, there are two problems.

  1. Getting users onboarded, this can be complex and difficult.
  2. Every single call requires specified credentials.

The toolkit will help to solve these problems. Using the bootstrap script, users can get onboarded by running a single line of code. The module itself and the related function will be used to call the internal repository without entering the credentials every call.

Installing

To use this module directly, you need to install it from the PowerShell Gallery:

Install-PSResource PSGetInternal -Scope CurrentUser

Alternatively, you may want to deploy it via bootstrap script to solve the fundamental chicken/egg problem of deploying the tools to deploy tools. For details on this see below.

Getting Started

Only use one time to register the repository. Is not needed, if bootstrap got used.

# Register the trusted repository "Internal-Repository" with SourceLocation "<Repository-URL>". Generate a credential file for this repository.
$cred = Get-Credential -UserName "<UserPrincipalName>" -Message "Provide PAT used to authenticate to the internal PowerShell Gallery"
Set-GIRepository -Name "Internal-Repository" -SourceLocation "<Repository-URL>" -InstallationPolicy "Trusted" -Credential $cred
# Register the trusted repository "Internal-Repository" with SourceLocation "<Repository-URL>". Generate a credential file for this repository and mark it as default.
$cred = Get-Credential -UserName "<UserPrincipalName>" -Message "Provide PAT used to authenticate to the internal PowerShell Gallery"
Set-GIRepository -Name "Internal-Repository" -SourceLocation "<Repository-URL>" -InstallationPolicy "Trusted" -Credential $cred -Default
# Install the module "<Internal-ModuleName>" from the configured Internal-Repository repository.
Install-GIModule -Name "<Internal-ModuleName>"

Bootstraping

  1. Provide a network share for the bootstrap script, where specific users have access to.
  2. Download bootstrap.ps1 from GitHub repository and store it on the network share.
  3. Perform the following command in PowerShell from a computer with access to both that network share and the PSGallery:

Be aware that "<network share path>" should be the same path, where the bootstrap script is stored!

# Save the module "PSGetInternal" to "<network share path>".
Save-PSResource -Name "PSGetInternal" -Path "<network share path>" -Repository "PSGallery"
  1. Edit the bootstrap script to your internal repository. Add your personal default settings under the first paramblock:
    $RepositoryName = "&lt;Name of the internal Repository&gt;"
    $Url = "&lt;Url of the internal Repository&gt;"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published