- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to install DSC resources using PowerShell?
To install the DSC resource using PowerShell, we can use the same command to install modules in PowerShell (Install-Module).
The Find-DscResource command would get all the available DSC resources. To search the specific DSC resource, you can provide the -Name parameter in the Find-DscReource command. For example, we need to search for the FilesAndFolder DSC resource
Find-DSCResource -Name filesandfolders
Output
Name Version ModuleName Repository ---- ------- ---------- ---------- FilesAndFolders 0.3.212 CommonTasks PSGallery
To install this module, we can pipeline the Install-Module command.
Find-DSCResource -Name filesandfolders | Install-Module -Force -Verbose
Once the module is installed, we can use the Get-DSCResource command to check if the module is installed properly.
Get-DscResource -Name FilesAndFolders
Output
To check the properties of the installed module, we can use the below command.
Get-DscResource -Name FilesAndFolders | Select -ExpandProperty Properties
Output
Name PropertyType IsMandatory Values ---- ------------ ----------- ------ DependsOn [String[]] False {} PsDscRunAsCredential [PSCredential] False {} Items [Hashtable[]] True {}
Advertisements