Skip to content

Save recurring script configurations in your PowerShell profile and have them always available via the $PSSCriptConfig variable.

License

Notifications You must be signed in to change notification settings

a-bode/PSScriptConfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

PSScriptConfig

Save recurring script configurations in your PowerShell profile and have them always available via the $PSSCriptConfig variable.

Installation

Install-Module PSScriptConfig
Import-Module PSScriptConfig
Register-PSScriptConfig

Configuration

Add Configuration

New-PSScriptConfig -Key mailRelay -Value mail.contoso.com
New-PSScriptConfig -Key mailRelayPort -Value 25
New-PSScriptConfig -Key mailFrom -Value admin@contoso.com

Get Configurations

$PSScriptConfig
$PSScriptConfig.mailRelay

Change Configuration

For the current session only.

$PSScriptConfig.mailRelay = "smtp.contoso.com"

Save permanently.

Save-PSScriptConfig

Remove Configuration

Remove-PSScriptConfig -Key mailRelay

Usage Example

Send-MailMessage -From $PSScriptConfig.mailFrom -SmtpServer $PSScriptConfig.mailRelay -Port $PSScriptConfig.mailRelayPort -To me@contoso.com -Subject test

About

Save recurring script configurations in your PowerShell profile and have them always available via the $PSSCriptConfig variable.

Resources

License

Stars

Watchers

Forks

Packages

No packages published