Get POSHDefault

Brandon Olin edited this page Jan 4, 2016 · 8 revisions

Retrieves a POSHOrigin configuration snippet as a hashtable that will be merged with the calling configuration resource. Useful for re-using partial configuration options across resources. Configuration snippets are hashtables saved with a .psd1 file extension.

Parameters

Name Type Required Description
Configuration string True Name of configuration snippet to retrieve. Do not include the file extension (.psd1)
Path string False Path to folder that holds the configuration snippets. Default value is retrieved from the configs_path parameter stored in $env:USERPROFILE.poshorigin\options.json

Aliases

gpd

Examples

Defines a vSphere:VM resource and retrieves the disk information from a configuration snippet named standard_disks.psd1.

standard_disks.psd1
@{
   name = 'Hard disk 1'
   sizeGB = 50
   type = 'flat'
   format = 'Thick'
   volumeName = 'C'
   volumeLabel = 'NOS'
   blockSize = 4096
},
@{
   name = 'Hard disk 2'
   sizeGB = 100
   type = 'flat'
   format = 'Thick'
   volumeName = 'D'
   volumeLabel = 'Data'
   blockSize = 4096
}
my_vm_config.ps1
resource 'POSHOrigin_vSphere:VM' 'VM01' @{
    ensure = 'present'
    description = 'Test VM'
    ###
    # Other options omitted for brevity
    ###
    disks = Get-POSHDefault 'standard_disks'
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.