Skip to content

Commit 5fdc34d

Browse files
committed
Update to Windows PowerShell
1 parent 71d475f commit 5fdc34d

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

build.ps1

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ $filesForWindowsPackage = @(
8888

8989
$filesForLinuxPackage = @(
9090
'bicep.dsc.extension.json',
91-
'convert-resource.ps1',
92-
'convertDscResource.psd1',
93-
'convertDscResource.psm1',
9491
'dsc',
9592
'dsc_default.settings.json',
9693
'dsc.settings.json',
@@ -105,7 +102,6 @@ $filesForLinuxPackage = @(
105102
'osinfo',
106103
'osinfo.dsc.resource.json',
107104
'powershell.dsc.resource.json',
108-
'powershell.dsc.extension.json'
109105
'psDscAdapter/',
110106
'psscript.ps1',
111107
'psscript.dsc.resource.json',
@@ -117,9 +113,6 @@ $filesForLinuxPackage = @(
117113

118114
$filesForMacPackage = @(
119115
'bicep.dsc.extension.json',
120-
'convert-resource.ps1',
121-
'convertDscResource.psd1',
122-
'convertDscResource.psm1',
123116
'dsc',
124117
'dsc_default.settings.json',
125118
'dsc.settings.json',
@@ -134,7 +127,6 @@ $filesForMacPackage = @(
134127
'osinfo',
135128
'osinfo.dsc.resource.json',
136129
'powershell.dsc.resource.json',
137-
'powershell.dsc.extension.json'
138130
'psDscAdapter/',
139131
'psscript.ps1',
140132
'psscript.dsc.resource.json',

extensions/powershell/powershell.tests.ps1 renamed to extensions/powershell/win_powershell.tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ BeforeDiscovery {
1010
}
1111

1212
Describe 'PowerShell extension tests' {
13-
It 'Example PowerShell file should work' -Skip:(!$isElevated) {
13+
It 'Example PowerShell file should work' -Skip:(!$IsWindows -or !$isElevated) {
1414
$psFile = Resolve-Path -Path "$PSScriptRoot\..\..\dsc\examples\variable.dsc.ps1"
1515
$out = dsc -l trace config get -f $psFile 2>$TestDrive/error.log | ConvertFrom-Json
1616
$LASTEXITCODE | Should -Be 0 -Because (Get-Content -Path $TestDrive/error.log -Raw | Out-String)
1717
$out.results[0].result.actualState.Ensure | Should -Be 'Absent'
1818
(Get-Content -Path $TestDrive/error.log -Raw) | Should -Match "Importing file '$psFile' with extension 'Microsoft.DSC.Extension/PowerShell'"
1919
}
2020

21-
It 'Invalid PowerShell configuration document file returns error' {
21+
It 'Invalid PowerShell configuration document file returns error' -Skip:(!$IsWindows) {
2222
$psFile = "$TestDrive/invalid.ps1"
2323
Set-Content -Path $psFile -Value @"
2424
configuration InvalidConfiguration {

extensions/powershell/powershell.dsc.extension.json renamed to extensions/powershell/windowspowershell.dsc.extension.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json",
33
"type": "Microsoft.DSC.Extension/PowerShell",
44
"version": "0.1.0",
5-
"description": "Enable passing PowerShell v2 configuration document file directly to DSC, but requires pwsh executable to be available.",
5+
"description": "Enable passing PowerShell v1 configuration document file directly to DSC. Works only on Windows.",
66
"import": {
77
"fileExtensions": ["ps1"],
8-
"executable": "pwsh",
8+
"executable": "powershell",
99
"args": [
1010
"-NoLogo",
1111
"-NonInteractive",

0 commit comments

Comments
 (0)