powershell-credentials
v0.1.2
Published
Read stored credentials from a CliXML file, and transform them to a JavaScript object. Requires node-powershell.
Downloads
6
Maintainers
Readme
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
- Create a set of stored credentials as a CliXML file in PowerShell using the
Get-Credential
andExport-Clixml
commands. - Import the credentials into your Node.js project as a JavaScript object with keys
user
andpass
. - 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)
})()