Skip to content

Commit 0682b39

Browse files
committed
Update to Windows PowerShell
1 parent ba03899 commit 0682b39

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
@@ -83,9 +83,6 @@ $filesForWindowsPackage = @(
8383

8484
$filesForLinuxPackage = @(
8585
'bicep.dsc.extension.json',
86-
'convert-resource.ps1',
87-
'convertDscResource.psd1',
88-
'convertDscResource.psm1',
8986
'dsc',
9087
'dsc_default.settings.json',
9188
'dsc.settings.json',
@@ -100,7 +97,6 @@ $filesForLinuxPackage = @(
10097
'osinfo',
10198
'osinfo.dsc.resource.json',
10299
'powershell.dsc.resource.json',
103-
'powershell.dsc.extension.json'
104100
'psDscAdapter/',
105101
'psscript.ps1',
106102
'psscript.dsc.resource.json',
@@ -112,9 +108,6 @@ $filesForLinuxPackage = @(
112108

113109
$filesForMacPackage = @(
114110
'bicep.dsc.extension.json',
115-
'convert-resource.ps1',
116-
'convertDscResource.psd1',
117-
'convertDscResource.psm1',
118111
'dsc',
119112
'dsc_default.settings.json',
120113
'dsc.settings.json',
@@ -129,7 +122,6 @@ $filesForMacPackage = @(
129122
'osinfo',
130123
'osinfo.dsc.resource.json',
131124
'powershell.dsc.resource.json',
132-
'powershell.dsc.extension.json'
133125
'psDscAdapter/',
134126
'psscript.ps1',
135127
'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)