PowerShell doesn't recognise DSC commands

It was working and now its not.
Has anyone else see this issue? All of a sudden PowerShell does not recognize the Configuration command.

Here is my sample configuration I am using
Configuration testing123
{
Import-DscResource -ModuleName ‘xTimeZone’

    xTimeZone Central{
        IsSingleInstance = 'yes'
        TimeZone         = 'Eastern Standard Time'
    }

}

Here is the error message I am receiving.
At line:1 char:15

  • Configuration testing123
  •           ~~~~~~~~~~
    

System.Management.Automation.PSArgumentException: Cannot process argument because the value of argument “fullFilePath” is not valid. Change the value of the “fullFilePath” argument and run the operation again.
at Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser.GetFileContent(String fullFilePath)
at Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser.ParseSchemaMof(String filePath)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.ImportClasses(String path, Tuple`2 moduleInfo, Collection`1 errors, Boolean importInBoxResourcesImplicitly)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.Initialize(Collection`1 errors, List`1 modulePathList)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Dictionary`2 functionsToDefine, Collection`1 errors, List`1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions)
at System.Management.Automation.Language.Parser.ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)
At line:2 char:1

  • {
  • ~
    Unexpected token ‘{’ in expression or statement.
    At line:9 char:1
  • }
  • ~
    Unexpected token ‘}’ in expression or statement.
    • CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException
    • FullyQualifiedErrorId : ParserError

What’s the context for where this is running?

FYI i have just tested this

Configuration testing123
{
Import-DscResource -ModuleName 'xTimeZone'

xTimeZone Central{
IsSingleInstance = 'yes'
TimeZone = 'Eastern Standard Time'
}
}

testing123

And it worked fine. How are you able to reproduce this?