Convert a linux script to powershell script

25 Views Asked by At

I need to translate this script (linux):

# get endpoint 
endpoint = aws codeartifact get-repository-endpoint --domain my_domain --domain-owner 111122223333 --repository my_repo --format npm

# set a scoped registry
npm config set registry endpoint --scope=@my-package <- this is what you want

# get token
token = aws codeartifact get-authorization-token --domain my_domain --domain-owner 111122223333 --repository my_repo

# set token
npm config set //my_domain-111122223333.d.codeartifact.region.amazonaws.com/npm/my_repo/:_authToken=token

# always truth
npm config set //my_domain-111122223333.d.codeartifact.region.amazonaws.com/npm/my_repo/:always-auth=true

To a powershell one. Especially, I cannot find a way to set the "endpoint" variable in powershell and recall it to set the scoped registry.

Source of the script: NPM insists on CodeArtifact, even on public registry

0

There are 0 best solutions below