Warning: Unable to find package provider ‘PSModule’ on Windows 10

Running Windows 10 Enterprise Preview Build 5.0.10158.0

When I run Find-Module, I receive the error message in the screenshot below.
CIX7pMsWEAAgUqK

After bashing my face against the problem for a while, I got some help from Ben Gelens, who provided the answer on how to fix the problem:

Get-PackageProvider -Name PSModule -ForceBootstrap

Once that is done, close and reopen the ISE (or the Console host) and you are good to go!

Unexpected Token ‘}’ in Expression or Statement when using $AllNodes in a Desired State Configuration

I was working on testing a custom DSC Resource when I came across a very strange issue. Whenever I tried to build a Configuration like the one below, it failed.

First Configuration:
$ConfigData =@{
    AllNodes = @(
        @{
            NodeName = '*'
            PSDSCAllowPlainTextPassword = $True
          }
    )

}

Configuration TestConfig{

    Import-DscResource -ModuleName @{ModuleName="xComputerManagement";ModuleVersion="1.3.0"}

    Node $AllNodes.Nodename{

        xComputer Test{
            Name = "MYPC"
        }

    }

}  

Under the very last curly brace there was a red squiggly line. When I tried to build the Configuration it failed with the error:

Unexpected token '}' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

It took me nearly an hour and a half to figure out what was causing the issue. Here is the working Configuration. Can you spot the difference?

$ConfigData =@{
    AllNodes = @(
        @{
            NodeName = '*'
            PSDSCAllowPlainTextPassword = $True
          }
    )

}

Configuration TestConfig{

    Import-DscResource -ModuleName @{ModuleName="xComputerManagement";ModuleVersion="1.3.0"}

    Node $AllNodes.NodeName {

        xComputer Test{
            Name = "MYPC"
        }

    }

}  

If you can’t spot the difference, the only difference is that in the second example, there is a space between $AllNodes.NodeName and the curly brace beginning the Node block. As you can imagine I have a serious problem with this, and believe this to be a bug. You will notice that I don’t need a space between the name of the Configuration and the curly brace, so why should I need a space after $AllNodes.NodeName? Also, in the next example, if I change $AllNodes.NodeName to Node MYPC, it doesn’t require a space between the node name and the curly brace either.

Configuration TestConfig{

    Import-DscResource -ModuleName @{ModuleName="xComputerManagement";ModuleVersion="1.3.0"}

    Node MYPC{

        xComputer Test{
            Name = "MYPC"
        }

    }

}  

All of this testing was done on Windows 10 Enterprise Preview edition with PowerShell Version 5.0.10158.0 . If you also believe this is a bug and should be fixed, vote up the issue on connect here.