Skip to content

Commit

Permalink
rename PowerShell and WMI resources
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveL-MSFT committed Mar 2, 2024
1 parent ebbbc81 commit 9cf510d
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 40 deletions.
5 changes: 2 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,12 @@ $projects = @(
"file_lib",
"dsc",
"osinfo",
"powershellgroup",
"powershell-adapter",
"process",
"tools/dsctest",
"tools/test_group_resource",
"y2j",
"powershellgroup",
"wmigroup",
"wmi-adapter",
"resources/brew"
)
$pedantic_unclean_projects = @("ntreg")
Expand Down
2 changes: 1 addition & 1 deletion dsc/examples/powershell.dsc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
resources:
- name: Use class PowerShell resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
resources:
- name: OpenSSH service
Expand Down
2 changes: 1 addition & 1 deletion dsc/tests/dsc_resource_list.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Describe 'Tests for listing resources' {
$resources.type | Should -Contain 'Microsoft/OSInfo'
($resources | Where-Object { $_.type -eq 'DSC/Group' }).Kind | Should -BeExactly 'Group'
($resources | Where-Object { $_.type -eq 'Microsoft/OSInfo' }).Kind | Should -BeExactly 'Resource'
($resources | Where-Object { $_.type -eq 'DSC/PowerShellGroup' }).Kind | Should -BeExactly 'Adapter'
($resources | Where-Object { $_.type -eq 'Microsoft.DSC/PowerShell' }).Kind | Should -BeExactly 'Adapter'
}

It 'dsc resource list --tags "<tags>" and --description "<description> work' -TestCases @(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Working with classic DSC resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
resources:
- name: Repository Info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Get info from classic DSC resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
resources:
- name: Get PS Repository Info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'PowerShellGroup resource tests' {
Describe 'PowerShell adapter resource tests' {

BeforeAll {
$OldPSModulePath = $env:PSModulePath
Expand Down Expand Up @@ -46,7 +46,7 @@ Describe 'PowerShellGroup resource tests' {
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Working with class-based resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
resources:
- name: Class-resource Info
Expand All @@ -67,13 +67,13 @@ Describe 'PowerShellGroup resource tests' {
$OldPSModulePath = $env:PSModulePath
Copy-Item -Recurse -Force -Path "$PSScriptRoot/PSTestModule" -Destination $TestDrive
Rename-Item -Path "$PSScriptRoot/PSTestModule" -NewName "_PSTestModule"

try {
$yaml = @"
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Working with class-based resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
psmodulepath: `$env:PSModulePath;$TestDrive
resources:
Expand Down Expand Up @@ -101,7 +101,7 @@ Describe 'PowerShellGroup resource tests' {
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Working with class-based resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
resources:
- name: Class-resource Info
Expand All @@ -126,7 +126,7 @@ Describe 'PowerShellGroup resource tests' {
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Working with class-based resources
type: DSC/PowerShellGroup
type: Microsoft.DSC/PowerShell
properties:
resources:
- name: Class-resource Info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'PowerShellGroup resource tests' {
Describe 'PowerShell adapter resource tests' {

BeforeAll {
$OldPSModulePath = $env:PSModulePath
$env:PSModulePath += ";" + $PSScriptRoot
$env:PSModulePath += [System.IO.Path]::PathSeparator + $PSScriptRoot
}
AfterAll {
$env:PSModulePath = $OldPSModulePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Get info from classic DSC resources
type: DSC/WindowsPowerShellGroup
type: Microsoft.Windows/WindowsPowerShell
properties:
resources:
- name: Get Info
Expand Down
1 change: 1 addition & 0 deletions powershell-adapter/copy_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell.resource.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
"type": "DSC/PowerShellGroup",
"type": "Microsoft.DSC/PowerShell",
"version": "0.1.0",
"description": "Resource adapter to classic DSC Powershell resources.",
"tags": [
Expand All @@ -14,7 +14,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"./powershellgroup.resource.ps1 List"
"./powershell.resource.ps1 List"
]
},
"config": "full"
Expand All @@ -26,7 +26,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 Get"
"$Input | ./powershell.resource.ps1 Get"
],
"input": "stdin"
},
Expand All @@ -37,7 +37,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 Set"
"$Input | ./powershell.resource.ps1 Set"
],
"input": "stdin",
"implementsPretest": true,
Expand All @@ -50,7 +50,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 Test"
"$Input | ./powershell.resource.ps1 Test"
],
"input": "stdin",
"return": "state"
Expand All @@ -62,7 +62,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 Export"
"$Input | ./powershell.resource.ps1 Export"
],
"input": "stdin",
"return": "state"
Expand All @@ -74,7 +74,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 Validate"
"$Input | ./powershell.resource.ps1 Validate"
]
},
"exitCodes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function RefreshCache
if (($PSVersionTable.PSVersion.Major -eq 7) -and ($PSVersionTable.PSVersion.Minor -eq 4) `
-and ($PSVersionTable.PSVersion.PreReleaseLabel.StartsWith("preview")))
{
throw "PowerShell 7.4-previews are not supported by PowerShellGroup resource; please use PS 7.4.0-rc.1 or newer."
throw "PowerShell 7.4-previews are not supported by PowerShell adapter resource; please use PS 7.4.0-rc.1 or newer."
}

$inputobj_pscustomobj = $null
Expand Down Expand Up @@ -98,7 +98,7 @@ if ($Operation -eq 'List')

$fullResourceTypeName = "$moduleName/$($r.ResourceType)"
$script:ResourceCache[$fullResourceTypeName] = $r
if ($WinPS) {$requiresString = "DSC/WindowsPowerShellGroup"} else {$requiresString = "DSC/PowerShellGroup"}
if ($WinPS) {$requiresString = "Microsoft.Windows/WindowsPowerShell"} else {$requiresString = "Microsoft.DSC/PowerShell"}

$z = [pscustomobject]@{
type = $fullResourceTypeName;
Expand Down Expand Up @@ -396,5 +396,5 @@ elseif ($Operation -eq 'Validate')
}
else
{
"ERROR: Unsupported operation requested from powershellgroup.resource.ps1"
"ERROR: Unsupported operation requested from powershell.resource.ps1"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifestVersion": "1.0",
"type": "DSC/WindowsPowerShellGroup",
"type": "Microsoft.Windows/WindowsPowerShell",
"version": "0.1.0",
"description": "Resource adapter to classic DSC Powershell resources in Windows PowerShell.",
"adapter": {
Expand All @@ -11,7 +11,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"./powershellgroup.resource.ps1 -WinPS List"
"./powershell.resource.ps1 -WinPS List"
]
},
"config": "full"
Expand All @@ -23,7 +23,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 -WinPS Get"
"$Input | ./powershell.resource.ps1 -WinPS Get"
]
},
"set": {
Expand All @@ -33,7 +33,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 -WinPS Set"
"$Input | ./powershell.resource.ps1 -WinPS Set"
],
"input": "stdin",
"preTest": true,
Expand All @@ -46,7 +46,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./powershellgroup.resource.ps1 -WinPS Test"
"$Input | ./powershell.resource.ps1 -WinPS Test"
],
"input": "stdin",
"return": "state"
Expand Down
1 change: 0 additions & 1 deletion powershellgroup/copy_files.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
resources:
- name: Get info from WMI
type: DSC/WMIGroup
type: Microsoft.Windows/WMI
properties:
resources:
- name: Get OS Info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'PowerShellGroup resource tests' {
Describe 'WMI adapter resource tests' {

BeforeAll {
if ($IsWindows)
Expand Down
2 changes: 2 additions & 0 deletions wmi-adapter/copy_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
wmi.resource.ps1
wmi.dsc.resource.json.optout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
"type": "DSC/WMIGroup",
"type": "Microsoft.Windows/WMI",
"version": "0.1.0",
"description": "Resource adapter to WMI resources.",
"tags": [
Expand All @@ -14,7 +14,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"./wmigroup.resource.ps1 List"
"./wmi.resource.ps1 List"
]
},
"config": "full"
Expand All @@ -26,7 +26,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./wmigroup.resource.ps1 Get"
"$Input | ./wmi.resource.ps1 Get"
],
"input": "stdin"
},
Expand All @@ -37,7 +37,7 @@
"-NonInteractive",
"-NoProfile",
"-Command",
"$Input | ./wmigroup.resource.ps1 Validate"
"$Input | ./wmi.resource.ps1 Validate"
]
},
"exitCodes": {
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions wmigroup/copy_files.txt

This file was deleted.

0 comments on commit 9cf510d

Please sign in to comment.