Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
titleExample for use of PowerShell cmdlets
linenumberstrue
# parameterizationParameterization
$gitServer   = 'github.com'
$gitAccount  = 'myAccount'
$gitUserName = 'My Account'
$gitUserMail = 'myAccount@example.com'
$gitKeyFile  = 'myKey.rsa'

# Connection
Import-Module JS7
Connect-JS7 -Url http://root:root@localhost:4446 -Id 'Controller'

# useUse of private key file
Add-JS7GitCredentials -Server $gitServer -Account $gitAccount -KeyFile $gitKeyFile -UserName $gitUserName -UserMail $gitUserMail

# useUse of access token (similarly insecure as use of passwords)
# Add-JS7GitCredentials -Server $gitServer -Account $gitAccount -AccessToken 'a1b2c3d4e5f6g7h8' -UserName $gitUserName -UserMail $gitUserMail

# useUse of password (denied by a larger number of Git Servers)
# Add-JS7GitCredentials -Server $gitServer -Account $gitAccount -Password (ConvertTo-SecureString 'secret' -AsPlainText -Force) -UserName $gitUserName -UserMail $gitUserMail

# removeRemove Git credentials
Remove-JS7GitCredentials -Server $gitServer

# Connection
Disconnect-JS7


Explanation: