All notable changes to this project will be documented in this file.
The format is based on and uses the types of changes according to Keep a Changelog, and this project adheres to Semantic Versioning.
Assert-BoundParameter
- Fixed example in documentation that were referencing an invalid command name.
- New public commands.
Get-EnvironmentVariable
- Get a specific environment variable from a specific environment variable target.Get-PSModulePath
- Get the the PSModulePath from one or more environment variable targets - Issue #103
- Added public function
Find-Certificate
that returns one or more certificates using certificate selector parameters - Issue #100- Related to CertificateDsc Issue #272.
- Added private function
Assert-RequiredCommandParameter
that throws an exception if a specified parameter is not assigned a value, and optionally throws only if a specific parameter is passed. - Issue #92- Related to SqlServerDsc Issue #1796.
- Added public function
Test-AccountRequirePassword
that returns true or false whether an account need a password to be passed - Issue #93- Related to SqlServerDsc Issue #1794.
- Added public command
Get-DscProperty
that returns a hashtable of available properties for a class-based resource. See comment-based help for more information. - Added public command
Test-DscProperty
that returns a true or false whether a property exist in a class-based resource. See comment-based help for more information. - Added private function
Test-DscPropertyIsAssigned
that returns a true or false whether a property in a class-based resource has a non-null value.
- DscResource.Common
- Updated Visual Studio Code project settings to configure testing for Pester 5.
Assert-BoundParameter
- Now has a new parameter set that calls
Assert-RequiredCommandParameter
which will throw an exception if a specified parameter is not assigned a value, and optionally throws only if a specific parameter is passed.
- Now has a new parameter set that calls
- Fixed unit tests for
Assert-ElevatedUser
andTest-IsNumericType
so the public function is tested correctly using the exported function. - Fixed unit tests to easier run test both from command line and inside Visual Studio Code.
- DscResource.Common
- Now builds the module into a separate folder
output/builtModule
.
- Now builds the module into a separate folder
Test-IsNumericType
- Now handles arrays correctly.
- Added public function
Test-IsNumericType
that returns whether the specified object is of a numeric type - Issue #87- Related to SqlServerDsc Issue #1795.
Assert-ElevatedUser
- Renamed the localized string key name and prepared the localized string file to be able to distinguish which key belong to which command.
- Added public function
Assert-ElevatedUser
that asserts the user has elevated the PowerShell session. Issue #82- Related to SqlServerDsc Issue #1797.
- DscResource.Common
- updating the Get-LocalizedData to bypass Import-LocalizedData when in Globalization-Invariant mode. The command throws when running on an Invariant culture on Linux in the latest PS versions.
- DscResource.Common
- Update pipeline files to the latest in Sampler.
- Fix missing tasks module.
- Update unit tests to import and remove the module being tested.
- Update pipeline files to the latest in Sampler.
- Correction to
Compare-DscParameterState
returning false positive when parameter with an empty hashtable or CimInstance property is passed inDesriedValues
- fixes issue #65. - Correction somes problems in
Compare-DscParameterState
- see issue #70 :- When you use
-ReverseCheck
, this value is used in recursive call ofTest-DscParameterState
andCompare-DscParameterState
, and that called another time the function. - When you use
-Properties
and-ReverseCheck
, and you have an array in member, that return a wrong value, because the properties are set in recursive calls of-ReverseCheck
to test the value of array. - When you use
-ReverseCheck
and, in the functionTest-DscCompareState
/Compare-DscParameterState
are recursively called (like to test or compare value of array),-ReverseCheck
value is removed from$PSBoundParameters
. And the ReverseCheck isn't done.
- When you use
- Added cmdlet
ConvertFrom-DscResourceInstance
which can be used to convert any object to in another format. It accepts objects from pipeline. issue #71. - Now code coverage is uploaded to codecov.io.
- Unit tests are now running using Pester 5 (issue #40).
- Excludes the PowerShell module script file DscResource.Common.psm1 located in folder source from the HQRM testing.
- DscResource.Common
- Renamed default branch to
main
- fixes issue #62. - Changed to use the new GitHub deploy tasks.
- Renamed default branch to
Assert-Module
- Now it possible to forcibly import a module using
-ImportModule -Force
- It no longer outputs verbose messages that is normally generated when
using
Get-Module -ListAvailable
if the module that is asserted is already in the session (issue #66).
- Now it possible to forcibly import a module using
Compare-DscParameterState
- Fix verbose message to only show when using parameter
IncludeInDesiredState
. Also made the verbose message more intuitive when the value being compared was a[System.Boolean]
.
- Fix verbose message to only show when using parameter
- Added cmdlet
Get-ComputerName
which can be used to returns the computer name cross-plattform. The variable$env:COMPUTERNAME
does not exist cross-platform which hinders development and testing on macOS and Linux. Instead this cmdlet can be used to get the computer name cross-plattform.
- Added cmdlet
Compare-DscParameterState
- Could be used in Get-TargetResource function or Get() method in Class based Resources. It is based on the code of Test-DscParameterState function to get compliance between current and desired state of resources. The OutPut of Compare-DscParameterState is a collection psobject. The properties of psobject are Property,InDesiredState,ExpectedType,ActualType, ExpectedValue and ActualValue. The IncludeInDesiredState parameter must be use to add ExeptedValue and ActualValue. - Added pester test to test the pscredential object with
Compare-DscParameterState
.
- Cmdlet Test-DscResourceState is now calling Compare-DscParameterState. Possible breaking change.
- IncludeInDesiredState and IncludeValue parameters of Compare-DscParameterState are removed in splatting when Test-DscCompareState is called.
- Fix git diff command in QA tests on Linux and MacOS.
- Correction to
Test-DscParameterState
returning false positive when parameter with an empty array is passed inDesriedValues
orCurrentValues
- fixes issue #53.
Test-DscParameterState
can now handle scriptblocks. The parameter 'ValuesToCheck' was renamed to 'Properties' but an alias was added so it is not a braking change. The parameter 'ExcludeProperties' was added.- Added a new test for the alias 'ValuesToCheck' pointing to 'Properties'.
- Added cmdlet
Compare-ResourcePropertyState
that also introduces a new design pattern to evaluate properties in both Test and Set - fixes issue #47.
Get-LocalizedData
- Added cmdlet
New-InvalidDataException
- fixes Issue #42. - Added cmdlet
Set-DscMachineRebootRequired
- fixes Issue #43. - Pinned
Pester
module version to4.10.1
to enable build untilv5.x
is ready for use.
- Added cmdlet
Set-PSModulePath
.
- Added a default value of
en-US
to theDefaultUICulture
parameter of theGet-LocalizedData
function Issue #33. - Fixing a problem with the latest ModuleBuild 1.7.0 that breaks the CI pipeline.
- Add missing private function
Test-DscObjectHasProperty
.
- Added the cmdlet
Assert-IPAddress
- Added the cmdlet
ConvertTo-CimInstance
. This cmdlet comes from NetworkingDsc. - Added the cmdlet
ConvertTo-Hashtable
. This cmdlet comes from NetworkingDsc.
- Update the README.md with new cmdlet documentation format.
- Update to use HQRM tests from the DscResource.Test module.
- Update the repository to use the latest version of ModuleBuilder.
- Update to use the latest pipeline files.
- BREAKING CHANGE: Updated the cmdlet
Test-DscParameterState
to match the one in the module NetworkingDsc which have been extended with for example checking credentials and types. This might be a breaking change in certain scenarios, for example the type checking if on by default. This change is required to be able to move the module NetworkingDsc to use this module.
- Added the cmdlet
Assert-BoundParameter
. This cmdlet comes from ComputerManagementDsc. - Added the cmdlet
Get-TemporaryFolder
. This cmdlet comes from SqlServerDsc. - Added GitHub templates in the repository to help contributors.
- Only run CI pipeline on branch
master
when there are changes to files inside thesource
folder.
- The regular expression for
minor-version-bump-message
in the fileGitVersion.yml
was changed to only raise minor version when the commit message contain the wordadd
,adds
,minor
,feature
, orfeatures
. - Fixed the pipeline paths trigger.
- Added
ImportModule
parameter toAssert-Module
function.
- Updated pipeline Windows VM image to windows-2019.
- Fixed the New-*Exception function unit tests to work correctly on PowerShell version 5, 6 and 7.
- Added the function
Assert-Module
.
- Updated the localized strings to have the unique id according to style guideline.
- Added more function documentation to the README.md.
- Fix minor style issue in functions.
- Changed the VS Code project settings to trim trailing whitespace for markdown files too.
- Changed the VS Code project setting
pipelineIndentationStyle
to use the correct style. - The deploy step is no longer run on forks.
- Azure Pipelines will no longer trigger on changes to just the CHANGELOG.md.
- Add section "How to implement" in the README.md.
- Added
Test-IsNanoServer
function - fixes Issue #9.
- Updating pipeline files to the latest in the template.
- Updating and added section Code of conduct.
- Updating and added section contribution.
- Update README.md.
- The cmdlet
Get-LocalizedData
can now detect localized filenames that are using both the basename and the basename plus the suffixstrings
. E.g.MSFT_Cluster.psd1
MSFT_Cluster.strings.psd1
- New module based on the functions available in DscResource.Template
- Change the minimum requirement to PowerShell 4.0.
- skip tests (it ...) using New-CimInstance when OS is not Windows (see issue #1)
- updating secrets and account used