Skip to content

BootstrapPSResourceGet

viscalyxbot edited this page Feb 18, 2024 · 2 revisions

BootstrapPSResourceGet

Parameters

Parameter Attribute DataType Description Allowed Values
IsSingleInstance Key SingleInstance Specifies that only a single instance of the resource can exist in one and the same configuration. Must always be set to the value Yes.
Destination Write System.String Specifies the destination path where the module should be saved. This parameter is mandatory when using the 'Destination' parameter set. The path must be a valid container. This parameter may not be used at the same time as the parameter ModuleScope.
ModuleScope Write System.String Specifies the scope for saving the module. This parameter is used when using the 'ModuleScope' parameter set. The valid values are 'CurrentUser' and 'AllUsers'. The default value is 'CurrentUser'. This parameter may not be used at the same time as the parameter Destination.
Version Write System.String Specifies the version of the Microsoft.PowerShell.PSResourceGet module to download. If not specified, the latest version will be downloaded.
Reasons Read PSResourceGetBootstrapReason[]

Description

The BootstrapPSResourceGet DSC resource is used to bootstrap the module Microsoft.PowerShell.PSResourceGet to the specified location.

It supports two parameter sets: 'Destination' and 'Scope'. The 'Destination' parameter set allows you to specify a specific location to save the module, while the 'ModuleScope' parameter set saves the module to the appropriate $env:PSModulePath location based on the specified scope ('CurrentUser' or 'AllUsers').

The built-in parameter PSDscRunAsCredential can be used to run the resource as another user.

Requirements

  • Target machine must be running a operating system supporting running class-based DSC resources.
  • Target machine must support running Microsoft.PowerShell.PSResourceGet.

Known issues

All issues are not listed here, see here for all open issues.

Property Reasons does not work with PSDscRunAsCredential

When using the built-in parameter PSDscRunAsCredential the read-only property Reasons will return empty values for the properties Code and **Phrase. The built-in property PSDscRunAsCredential does not work together with class-based resources that using advanced type like the parameter Reasons have.

Clone this wiki locally