Skip to content

Read stored credentials from a CliXML file, and transform them to a JavaScript object. Requires `node-powershell`.

Notifications You must be signed in to change notification settings

jesseGlacken/powershell-credentials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

powershell-credentials

Read stored credentials from a CliXML file, and transform them to a JavaScript object. Requires node-powershell.

Install

npm install --save powershell-credentials

Usage

  1. Create a set of stored credentials as a CliXML file in PowerShell using the Get-Credential and Export-Clixml commands.
  2. Import the credentials into your Node.js project as a JavaScript object with keys user and pass.
  3. Use those credentials wherever your project requires them.

PowerShell

$Credentials = Get-Credential
$Credentials | Export-Clixml ./path/to/credentials.xml

index.js

import { readCredentials } from 'powershell-credentials'

(async () => {
    let credentials = await readCredentials('./path/to/credentials.xml')
    console.log(credentials)
})()

About

Read stored credentials from a CliXML file, and transform them to a JavaScript object. Requires `node-powershell`.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published