diff --git a/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/examples/manage-a-windows-service.md b/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/examples/manage-a-windows-service.md index 9fa9cbf12..904c1af95 100644 --- a/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/examples/manage-a-windows-service.md +++ b/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/examples/manage-a-windows-service.md @@ -1,6 +1,6 @@ --- description: > - Examples showing how you can invoke the Microsoft.Windows/WindowsPowerShell with DSC to manage + Examples showing how you can invoke the Microsoft.Windows/WindowsPowerShell with DSC to manage a Windows service using the PSDesiredStateConfiguration module. ms.date: 03/25/2025 @@ -54,7 +54,7 @@ When the resource configures the service, DSC returns the following result: ```yaml beforeState: - Status: null / + Status: null Description: This service spools print jobs and handles interaction with the printer. If you turn off this service, you won't be able to print or see your printers. DisplayName: Print Spooler ResourceId: null @@ -109,7 +109,7 @@ dsc resource test --resource PSDesiredStateConfiguration/Service --input $instan ```yaml desiredState: - Name: Spooler + Name: Spooler StartupType: Manual actualState: InDesiredState: true @@ -135,7 +135,7 @@ When the resource stops the service, DSC returns the following result: ```yaml beforeState: - Status: null + Status: null Description: This service spools print jobs and handles interaction with the printer. If you turn off this service, you won't be able to print or see your printers. DisplayName: Print Spooler ResourceId: null @@ -192,7 +192,7 @@ dsc resource get --resource PSDesiredStateConfiguration/Service --input $instanc ```yaml actualState: - Status: null + Status: null Description: This service spools print jobs and handles interaction with the printer. If you turn off this service, you won't be able to print or see your printers. DisplayName: Print Spooler ResourceId: null diff --git a/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/index.md b/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/index.md index 026724e41..914640ffb 100644 --- a/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/index.md +++ b/docs/reference/resources/Microsoft/Windows/WindowsPowerShell/index.md @@ -131,7 +131,7 @@ To list the schema properties for a PowerShell DSC resource, you can run the fol ```powershell dsc resource list --adapter Microsoft.Windows/WindowsPowerShell / | - ConvertFrom-Json | + ConvertFrom-Json | Select-Object properties ``` @@ -141,7 +141,7 @@ You can also retrieve more information by directly reading it from the cache fil $cache = Get-Content -Path "$env:LOCALAPPDATA\dsc\WindowsPSAdapterCache.json" | ConvertFrom-Json -($cache.ResourceCache | Where-Object -Property type -EQ '/').DscResourceInfo.Properties +($cache.ResourceCache | Where-Object -FilterScript { $_.type -eq '/' }).DscResourceInfo.Properties ``` When defining a configuration document, the following properties are required.