You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here
code -v
$pseditor.EditorServicesVersion
code --list-extensions --show-versions
$PSVersionTable
Formatting (via rightclick+Fomat Document) a DSC configuration that has a Where clause in the node name inserts a space between Node $Whatever.Where, which renders the Configuration invalid. I have to manually remove the space between Where and the opening bracket.
Steps to repro:
Create a Configuration, for example:
-- Stick the below text in a text file, named test.ps1 --
Set-StrictMode -Version Latest
Luckily we just fixed this issue and we're shipping a new update today :) Closing this for now, let us know if you still run into trouble with it after the 0.12.0 update.
System Details
$PSVersionTable
:Name Value
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
[CCNU217908U][C:\sourcecode\Shared\gitprojects\DSC]#code -v
1.10.2
8076a19fdcab7e1fc1707952d652f0bb6c6db331
[CCNU217908U][C:\sourcecode\Shared\gitprojects\DSC]#$pseditor.EditorServicesVersion
Major Minor Build Revision
0 11 0 0
[CCNU217908U][C:\sourcecode\Shared\gitprojects\DSC]#code --list-extensions --show-versions
donjayamanne.python@0.6.0
DotJoshJohnson.xml@1.7.0
EditorConfig.EditorConfig@0.6.2
luggage66.VBScript@0.0.1
ms-vscode.cpptools@0.10.5
ms-vscode.csharp@1.8.1
ms-vscode.PowerShell@0.11.0
searKing.preview-vscode@1.1.4
[CCNU217908U][C:\sourcecode\Shared\gitprojects\DSC]#
[CCNU217908U][C:\sourcecode\Shared\gitprojects\DSC]#$PSVersionTable
Name Value
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
I am experiencing a problem with...
Formatting (via rightclick+Fomat Document) a DSC configuration that has a Where clause in the node name inserts a space between Node $Whatever.Where, which renders the Configuration invalid. I have to manually remove the space between Where and the opening bracket.
Steps to repro:
Create a Configuration, for example:
-- Stick the below text in a text file, named test.ps1 --
Set-StrictMode -Version Latest
Configuration TestConfiguration
{
Import-DscResource -ModuleName PSDesiredStateConfiguration
}
$ConfigurationData = @{
AllNodes = @(
@{
NodeName = "*"
Architecture = "x64"
}
@{
NodeName = "CCNU217908U"
OS = "6.1.7601"
}
TestConfiguration -ConfigurationData $ConfigurationData
--- Code Above --
Then, run test.ps1 to make sure it works
Next, right click, pick Format Document, and you'll notice that
node $AllNodes.Where{ $_.OS -eq $ConfigurationData.globalWin7Version}.NodeName
will become
node $AllNodes.Where { $_.OS -eq $ConfigurationData.globalWin7Version}.NodeName
which when you run the configuration again, gets you the error
At C:\hold\test.ps1:7 char:75
Undefined DSC resource '.NodeName'. Use Import-DSCResource to import the resource.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : ResourceNotDefined
Attached Logs
Follow the instructions in the README
about capturing and sending logs.
The text was updated successfully, but these errors were encountered: