Skip to content

Commit 1129edc

Browse files
committed
Fix tests
1 parent 954b0e9 commit 1129edc

File tree

7 files changed

+9
-20
lines changed

7 files changed

+9
-20
lines changed

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $filesForWindowsPackage = @(
6363
'osinfo.exe',
6464
'osinfo.dsc.resource.json',
6565
'powershell.dsc.resource.json',
66-
'powershell.dsc.extension.json'
66+
'windowspowershell.dsc.extension.json'
6767
'psDscAdapter/',
6868
'psscript.ps1',
6969
'psscript.dsc.resource.json',

extensions/powershell/convert-resource.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ param (
77
begin {
88
$lines = [System.Collections.Generic.List[string]]::new()
99

10-
$scriptModule = Import-Module "$PSScriptRoot/convertDscResource.psd1" -Force -PassThru
10+
$scriptModule = Import-Module "$PSScriptRoot/convertDscResource.psd1" -Force -PassThru -ErrorAction Ignore
1111
}
1212

1313
process {
@@ -19,7 +19,7 @@ process {
1919
end {
2020
if ($lines.Count -ne 0) {
2121
$result = $scriptModule.invoke( { param($lines) Build-DscConfigDocument -Content $lines }, ($lines | Out-String) )
22-
22+
2323
return ($result | ConvertTo-Json -Depth 10 -Compress)
2424
}
2525
}

extensions/powershell/convertDscResource.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ AliasesToExport = @()
4141

4242
PrivateData = @{
4343
PSData = @{
44-
ProjectUri = 'https://github.com/PowerShell/dsc'
44+
ProjectUri = 'https://github.com/PowerShell/DSC'
4545
}
4646
}
4747
}

extensions/powershell/convertDscResource.psm1

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
$Script:IsPowerShellCore = $PSVersionTable.PSEdition -eq 'Core'
2-
3-
if ($Script:IsPowerShellCore)
4-
{
5-
if ($IsWindows)
6-
{
7-
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion 1.1 -UseWindowsPowerShell -WarningAction SilentlyContinue
8-
}
9-
Import-Module -Name 'PSDesiredStateConfiguration' -MinimumVersion 2.0.7 -Prefix 'Pwsh'
10-
}
11-
121
function Write-DscTrace {
132
param(
143
[Parameter(Mandatory = $false)]
@@ -19,7 +8,7 @@ function Write-DscTrace {
198
)
209

2110
$trace = @{$Operation.ToLower() = $Message } | ConvertTo-Json -Compress
22-
$host.ui.WriteLine($trace)
11+
$host.ui.WriteErrorLine($trace)
2312
}
2413

2514
function Build-DscConfigDocument

extensions/powershell/copy_files.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
powershell.dsc.extension.json
1+
windowspowershell.dsc.extension.json
22
convert-resource.ps1
33
convertDscResource.psd1
44
convertDscResource.psm1

extensions/powershell/win_powershell.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ configuration InvalidConfiguration {
3232
}
3333
}
3434
"@
35-
$out = dsc -l trace config get -f $psFile 2>$TestDrive/error.log | ConvertFrom-Json
35+
dsc -l trace config get -f $psFile 2>$TestDrive/error.log
3636
$LASTEXITCODE | Should -Be 2 -Because (Get-Content -Path $TestDrive/error.log -Raw | Out-String)
3737
$content = (Get-Content -Path $TestDrive/error.log -Raw)
3838
$content | Should -BeLike "*Importing file '$psFile' with extension 'Microsoft.DSC.Extension/PowerShell'*"

extensions/powershell/windowspowershell.dsc.extension.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json",
3-
"type": "Microsoft.DSC.Extension/PowerShell",
3+
"type": "Microsoft.DSC.Extension/WindowsPowerShell",
44
"version": "0.1.0",
5-
"description": "Enable passing PowerShell v1 configuration document file directly to DSC. Works only on Windows.",
5+
"description": "Enable passing Windows PowerShell v1 configuration document file directly to DSC. Works only on Windows.",
66
"import": {
77
"fileExtensions": ["ps1"],
88
"executable": "powershell",

0 commit comments

Comments
 (0)