Powershell module using Create and Enable/Disable local modules with a specific format called Environments. Use it if you you want to implement some functionality applicable only for a specific location, e.g. a function Organize-PhotosByDate
that can be stored in your Photos
directory.
Install-Module -Name Env
The module consists of functions:
- Basic operations:
New-Environment [Name] [Path]
- psenv is used when the name is not providedEnable-Environment [Path]
Disable-Environment [Name]
Get-Environment
Test-DirIsEnv {Dir}
- Module management:
Add-EnvironmentModule {EnvironmentPath} {Module}
Remove-EnvironmentModule {EnvironmentPath} {Module}
Get-EnvironmentModules {EnvironmentPath}
{}
- Mandatory argument
[]
- Optional argument
The suggested workflow is following:
- Create an Environment using
New-Environment
- Modify you environment in the newly created folder as you wish
- Activate the environment when you need it using
Enable-Environment
. You CAN activate several environments with unique names at once - Deactivate an environment using
Disable-Environment
. To get list of all activate environments useGet-Environment
How to... | Demo |
---|---|
...create a new environment | |
...add a new module to the environment | |
...enable and disable the environment |
This work is licensed under the terms of the MIT license.
For a copy, see: LICENSE
- site: https://agramakov.me
- e-mail: mail@agramakov.me
Any amount will motivate me to develop the project. Thanks you!