POSHOrigin icon indicating copy to clipboard operation
POSHOrigin copied to clipboard

Add ability to specifiy variables when importing config.

Open ThePSAdmin opened this issue 8 years ago • 1 comments

It would be nice to have a way to specify parameters or variables at run time instead of having them hardcoded in the POSHOrigin module.

Expected Behavior

When running Get-PoshOriginConfig, it would be nice to have an -Arguments parameter which accepts a hash table of parameters to inject into the config file. If we take terraform for example, you can run terraform apply -var foo=bar. An equivalent in POSHOrigin would be to run $config = Get-POSHOriginConfig -Path '.\module.ps1' -Arguments @{foo='Bar'}

Current Behavior

At the moment, I've worked around this by specifying global variables which are used in my POSHOrigin modules and then running Get-POSHOriginConfig. It works, but global variables...

ThePSAdmin avatar Nov 21 '17 11:11 ThePSAdmin

I like the idea @ThePSAdmin.

The way to accomplish this right now is with POSHOrigin modules. They work very similar to (and were inspired by) Terraform modules and allow you to accept arbitrary parameters into the module. You can then use these parameters to construct the resource you need.

devblackops avatar Nov 22 '17 06:11 devblackops