dsccommunity / DscResource.Common

This module contains common functions that are used in DSC resources.
https://dsccommunity.org
MIT License
9 stars 9 forks source link

Add Assert-ElevatedUser from SqlServerDsc to DscResource.Common Public Functions #82

Closed hollanjs closed 1 year ago

hollanjs commented 1 year ago

Problem description

The request to move Assert-ElevatedUser to the DscResource.Common module was created in the SqlServerDsc module under Issue 1797.

This function is used to assert the user is using an elevated PowerShell session, and that it could also better the entire DSC community by being included in the DscResource.Common module.

The function can be placed prior to commands that require elevated permissions, e.g. ... Assert-ElevatedUser -ErrorAction 'Stop' [Code that requires elevated permissions] ...

Verbose logs

N/A

How to reproduce

N/A

Expected behavior

N/A

Current behavior

N/A

Suggested solution

N/A

Operating system the target node is running

N/A

PowerShell version and build the target node is running

N/A

Module version used

0.11.1