Odd powershell error

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Ryan Young Ryan Young 2 years ago.

  • Author
    Posts
  • #20746
    Profile photo of Ryan Young
    Ryan Young
    Participant

    I have this DSC config in a "composite resource" and when I try to test it powershell is throwing me an error

    Configuration rFileServer 
    {
            WindowsFeature Gui {           
                    Ensure = "Present" 
                    Name   = "Server-Gui-Shell"
                    
                    
            }    
            WindowsFeature GuiMgmt {           
                    Ensure = "Present" 
                    Name   = "Server-Gui-Mgmt-Infra"
                  
    
            }   
            WindowsFeature FsFsFs  {          
                    Ensure = "Present" 
                    Name   = "File-Services"
            }    
             WindowsFeature   Dedup  {       
                    Ensure = "Present" 
                    Name   = "FS-Data-Deduplication"
            }    
            WindowsFeature  DFSname {          
                    Ensure = "Present" 
                    Name   = "FS-DFS-Namespace"
            }    
            WindowsFeature  DFSrep {          
                    Ensure = "Present" 
                    Name   = "FS-DFS-Replication"
            }    
            WindowsFeature   Resourceman{          
                    Ensure = "Present" 
                    Name   = "FS-Resource-Manager"
            }    
            WindowsFeature    Printserv {        
                    Ensure = "Present" 
                    Name   = "Print-Server"
            }    
        
            SmbShare Apps {           
                    Name        = "Apps"
                    Path        = "c:\shares\Apps" 
                    Description = "Branch Application Share"
                    Ensure      = "Present"
                    DependsOn   = "[File]AppFolder"
                    FullAccess  = "Everyone"
            }    
            SmbShare User  {          
                    Name        = "User$"
                    Path        = "c:\shares\User" 
                    Description = "Branch User Share"
                    Ensure      = "Present"
                    DependsOn   = "[File]UserFolder"
                    FullAccess  = "Everyone"
            }    
            SmbShare Share {           
                    Name        = "Share"
                    Path        = "c:\shares\Share" 
                    Description = "Branch Group Share"
                    Ensure      = "Present"
                    DependsOn   = "[File]ShareFolder"
                    FullAccess  = "Everyone"
            }       
            File AppFolder {           
                    Ensure          = "Present"
                    DestinationPath = "c:\shares\Apps"
                    Type            = "Directory"
            }    
            File UserFolder {   
                    Ensure          = "Present"
                    DestinationPath = "c:\shares\User"
                    Type            = "Directory"
            }    
             File Sharefolder {  
                    Ensure          = "Present"
                    DestinationPath = "c:\shares\Share"
                    Type            = "Directory"
            }   
    }

    And for the error:

    rFileServer
    
    PSDesiredStateConfiguration\Configuration : 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 C:\CieDSCCustom\Making Resources\CieCustomComposite\WindowsPowershell\Modules\rFileServer\DSCResources\rFileServer\rFileServer.schema.psm1:1 char:1
    + Configuration rFileServer
    + ~~~~~~~~~~~~~
        + CategoryInfo          : MetadataError: (:) [Configuration], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : ScriptBlockArgumentNoInput,Configuration
     
    Errors occurred while processing configuration 'rFileServer'.
    At C:\windows\system32\windowspowershell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2088 char:5
    +     throw $errorRecord
    +     ~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (rFileServer:String) [], InvalidOperationException
        + FullyQualifiedErrorId : FailToProcessConfiguration
    

    Any hints? 🙂 I am near finally putting my first 'true test config' out there for display to the boss!

  • #20756
    Profile photo of Ryan Young
    Ryan Young
    Participant

    Plz ignore this one! I fixed this tidbit. It was an issue with not having imported the dsc resource.

    Thanks! 🙂

You must be logged in to reply to this topic.