dsccommunity / ComputerManagementDsc

DSC resources for for configuration of a Windows computer. These DSC resources allow you to perform computer management tasks, such as renaming the computer, joining a domain and scheduling tasks as well as configuring items such as virtual memory, event logs, time zones and power settings.
https://dsccommunity.org
MIT License
300 stars 83 forks source link

SmbShare: Problem Creating the Fileshare #375

Closed Qi-Jian-Huang-DevOps closed 3 years ago

Qi-Jian-Huang-DevOps commented 3 years ago

Details of the scenario you tried and the problem that is occurring

When try to create fileshare resource using following, then get an error:

SmbShare CreateFileShare { Ensure = 'present' Name = 'test' Path = 'C:\test' }

Verbose logs showing the problem

PSDesiredStateConfiguration\Node : Cannot evaluate parameter 'ScopeName' because its argument is specified as a script block and there is no input. A script block cannot be evaluated without input. At line:56 char:1

Compilation errors occurred while processing configuration 'DscConfiguration'. Please review the errors reported in error stream and modify your configuration code appropriately. At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3917 char:5

The operating system the target node is running

Edition: Windows Server 2019 Datacenter Version: 1809 OS Build: 17763.1999

Version and build of PowerShell the target node is running

Version


5.1.17763.1971

Version of the DSC module that was used ('dev' if using current dev branch)

SmbShare ComputerManagementDsc 8.4.0

Qi-Jian-Huang-DevOps commented 3 years ago

Resolved the issue. Forgot to import DSC module 'ComputerManagementDsc'.