DscResource.Common

0.17.0

Common functions used in DSC Resources

Minimum PowerShell version

4.0

There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name DscResource.Common -RequiredVersion 0.17.0

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name DscResource.Common -Version 0.17.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

Copyright the DSC Community contributors. All rights reserved.

Package Details

Author(s)

  • DSC Community

Tags

DSC Localization

Functions

Assert-BoundParameter Assert-ElevatedUser Assert-IPAddress Assert-Module Compare-DscParameterState Compare-ResourcePropertyState ConvertFrom-DscResourceInstance ConvertTo-CimInstance ConvertTo-HashTable Find-Certificate Get-ComputerName Get-DscProperty Get-EnvironmentVariable Get-LocalizedData Get-LocalizedDataForInvariantCulture Get-PSModulePath Get-TemporaryFolder New-ArgumentException New-ErrorRecord New-Exception New-InvalidDataException New-InvalidOperationException New-InvalidResultException New-NotImplementedException New-ObjectNotFoundException Remove-CommonParameter Set-DscMachineRebootRequired Set-PSModulePath Test-AccountRequirePassword Test-DscParameterState Test-DscProperty Test-IsNanoServer Test-IsNumericType

Dependencies

This module has no dependencies.

Release Notes

## [0.17.0] - 2024-01-23

### Added

- Tasks for automating documentation for the GitHub repository wiki ([issue #110](https://github.com/dsccommunity/DscResource.Common/issues/110)).
- `Set-PSModulePath`
 - A new parameters set takes two parameters `FromTarget` and `ToTarget`
   that can copy from omne target to the other ([issue #102](https://github.com/dsccommunity/DscResource.Common/issues/102)).
 - A new parameter `PassThru` that, if specified, returns the path that
   was set.
- `New-Exception`
 - New command that creates and returns an `[System.Exception]`.
- `New-ErrorRecord`
 - New command that creates and returns an `[System.Management.Automation.ErrorRecord]`
   ([issue #99](https://github.com/dsccommunity/DscResource.Common/issues/99)).
- `New-ArgumentException`
 - Now takes a parameter `PassThru` that returns the error record that was
   created (and does not throw).
- `New-InvalidOperationException`
 - Now takes a parameter `PassThru` that returns the error record that was
   created (and does not throw) ([issue #98](https://github.com/dsccommunity/DscResource.Common/issues/98)).
- `New-InvalidResultException`
 - Now takes a parameter `PassThru` that returns the error record that was
   created (and does not throw).
- `New-NotImplementedException`
 - Now takes a parameter `PassThru` that returns the error record that was
   created (and does not throw).
- `Compare-DscParameterState`
 - Add support for the type `[System.Collections.Specialized.OrderedDictionary]`
   passed to parameters `CurrentValues` and `DesiredValues` ([issue #57](https://github.com/dsccommunity/DscResource.Common/issues/57)).
 - Add support for `DesiredValues` (and `CurrentValues`) to pass a value,
   e.g a hashtable, that includes a property with the type `[System.Collections.Specialized.OrderedDictionary]`
   or an array of `[System.Collections.Specialized.OrderedDictionary]` ([issue #57](https://github.com/dsccommunity/DscResource.Common/issues/57)).

### Changed

- Updated the pipelines files for resolving dependencies.
- Command documentation was moved from README to GitHub repository wiki.
- Change the word cmdlet to command throughout in the documentation, code
 and localization strings.
- A meta task now removes the built module from the session if it is imported.
- Wiki source file HOME was modified to not link to README for help after
 command documentation now is in the wiki.
- `Get-LocalizedData`
 - Refactored to simplify execution and debugging. The command previously
   used a steppable pipeline (proxies `Import-LocalizedData`), that was
   removed since it was not possible to use the command in a pipeline.
   It just made it more complex and harder to debug. There are more
   debug messages added to hopefully simplify solving some hard to find
   edge cases bugs.
- `New-ArgumentException`
 - Now has a command alias `New-InvalidArgumentException` and the command
   was renamed to match the exception name.
 - Now uses the new command `New-ErrorRecord`.
- `New-InvalidDataException`
 - The parameter `Message` has a parameter alias `ErrorMessage` to make
   the command have the same parameter names as the other `New-*Exception`
   commands.
 - Now uses the new command `New-ErrorRecord`.
- `New-InvalidOperationException`
 - Now uses the new command `New-ErrorRecord`.
- `New-InvalidResultException`
 - Now uses the new command `New-ErrorRecord`.
- `New-NotImplementedException`
 - Now uses the new command `New-ErrorRecord`.
- `New-ObjectNotFoundException`
 - Now uses the new command `New-ErrorRecord`.

### Fixed

- `Assert-BoundParameter`
 - Fixed example in documentation that were referencing an invalid command name.
- `Get-LocalizedData`
 - One debug message was wrongly using a format operator ([issue #111](https://github.com/dsccommunity/DscResource.Common/issues/111).
- `New-ObjectNotFoundException`
 - Updated typo in comment-based help.

FileList

Version History

Version Downloads Last updated
0.17.1-previ... 78 2/13/2024
0.17.1-previ... 113 1/27/2024
0.17.0 (current version) 971 1/23/2024
0.17.0-previ... 4 1/23/2024
0.17.0-previ... 4 1/23/2024
0.17.0-previ... 4 1/23/2024
0.17.0-previ... 4 1/23/2024
0.17.0-previ... 4 1/21/2024
0.17.0-previ... 4 1/21/2024
0.16.1-previ... 4 1/21/2024
0.16.1-previ... 11 1/20/2024
0.16.0 6,433 4/10/2023
0.16.0-previ... 5 4/9/2023
0.15.0 92 4/6/2023
0.15.0-previ... 5 4/6/2023
0.14.0 1,671 12/31/2022
0.14.0-previ... 5 12/31/2022
0.14.0-previ... 5 12/30/2022
0.13.1 172 12/18/2022
0.13.1-previ... 5 12/18/2022
0.13.0 21 12/17/2022
0.13.0-previ... 5 12/17/2022
0.13.0-previ... 5 12/11/2022
0.12.0 162 12/10/2022
0.12.0-previ... 5 12/10/2022
0.11.1 1,300 8/18/2022
0.11.1-previ... 10 8/18/2022
0.11.0 435 8/1/2022
0.11.0-previ... 10 8/1/2022
0.11.0-previ... 97 9/10/2021
0.10.3 3,149 6/26/2021
0.10.3-previ... 17 5/24/2021
0.10.2 1,227 3/24/2021
0.10.2-previ... 15 3/24/2021
0.10.2-previ... 17 1/18/2021
0.10.1 1,300 12/25/2020
0.10.1-previ... 16 12/25/2020
0.10.0 447 11/18/2020
0.10.0-previ... 13 11/16/2020
0.10.0-previ... 12 11/13/2020
0.9.3 656 7/25/2020
0.9.3-previe... 13 7/25/2020
0.9.2 64 7/22/2020
0.9.2-previe... 11 7/22/2020
0.9.2-previe... 11 7/22/2020
0.9.2-previe... 13 7/18/2020
0.9.1 148 7/8/2020
0.9.1-previe... 11 7/8/2020
0.9.0 1,197 5/18/2020
0.9.0-previe... 11 5/18/2020
0.8.0 202 5/11/2020
0.8.0-previe... 13 5/10/2020
0.7.1 359 5/2/2020
0.7.1-previe... 12 5/2/2020
0.7.0 14 5/2/2020
0.7.0-previe... 13 5/2/2020
0.7.0-previe... 16 5/1/2020
0.6.0 153 4/23/2020
0.6.0-previe... 18 4/23/2020
0.5.0 193 4/18/2020
0.5.0-previe... 18 4/18/2020
0.4.1-previe... 18 4/18/2020
0.4.0 267 3/9/2020
0.4.0-previe... 14 3/9/2020
0.3.0 99 2/15/2020
0.3.0-previe... 14 2/15/2020
0.3.0-previe... 17 2/14/2020
0.3.0-previe... 14 1/19/2020
0.2.0 951 1/9/2020
0.2.0-previe... 15 1/9/2020
0.1.1 108 11/27/2019
0.1.1-previe... 14 11/27/2019
Show more