Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add windows.optionalfeatures resource #4130

Merged
merged 3 commits into from
Jun 3, 2024
Merged

Conversation

czunker
Copy link
Contributor

@czunker czunker commented May 29, 2024

Related-to #3705

@czunker
Copy link
Contributor Author

czunker commented May 29, 2024

This allows to show, e.g., the powershell v2 feature on Windows 11:

PS C:\Users\User> .\cnquery.exe run -c 'windows.optionalfeatures.where(name == /PowerShell/){*}'
- no provider specified, defaulting to local. Use --help to see all providers.
- no Mondoo configuration file provided, using defaults
windows.optionalfeatures.where: [
  0: {
    displayName: "Windows PowerShell 2.0"
    name: "MicrosoftWindowsPowerShellV2Root"
    enabled: true
    description: "Adds or Removes Windows PowerShell 2.0"
    state: 2
  }
  1: {
    displayName: "Windows PowerShell 2.0 Engine"
    name: "MicrosoftWindowsPowerShellV2"
    enabled: true
    description: "Adds or Removes Windows PowerShell 2.0 Engine"
    state: 2
  }
  2: {
    displayName: "Hyper-V Module for Windows PowerShell"
    name: "Microsoft-Hyper-V-Management-PowerShell"
    enabled: false
    description: "Includes Windows PowerShell cmdlets for managing Hyper-V."
    state: 0
  }
]

This comment has been minimized.

Copy link
Contributor

github-actions bot commented May 29, 2024

Test Results

3 032 tests  +1   3 031 ✅ +1   1m 19s ⏱️ -7s
  337 suites ±0       1 💤 ±0 
   24 files   ±0       0 ❌ ±0 

Results for commit 6cb4e2b. ± Comparison against base commit dc5835c.

♻️ This comment has been updated with latest results.

@czunker czunker force-pushed the czunker/win_opt_feature branch from 81dc479 to de78554 Compare May 29, 2024 08:55
@tas50
Copy link
Member

tas50 commented May 29, 2024

Is the name and output of these the same as the server windows features @czunker ?

@czunker
Copy link
Contributor Author

czunker commented Jun 3, 2024

Is the name and output of these the same as the server windows features @czunker ?

No and no.

@czunker czunker force-pushed the czunker/win_opt_feature branch from de78554 to cbca1cd Compare June 3, 2024 04:35

This comment has been minimized.

@czunker czunker force-pushed the czunker/win_opt_feature branch from cbca1cd to 07791c8 Compare June 3, 2024 04:39

This comment has been minimized.

@czunker
Copy link
Contributor Author

czunker commented Jun 3, 2024

PS C:\Users\User> .\cnquery.exe run -c "windows.optionalFeature('MicrosoftWindowsPowerShellV2').enabled"
- no provider specified, defaulting to local. Use --help to see all providers.
- no Mondoo configuration file provided, using defaults
[ok] value: true

PS C:\Users\User>

@czunker czunker force-pushed the czunker/win_opt_feature branch from 07791c8 to e2b8b50 Compare June 3, 2024 04:53
Related-to #3705

Signed-off-by: Christian Zunker <christian@mondoo.com>
@czunker czunker force-pushed the czunker/win_opt_feature branch from e2b8b50 to 6cb4e2b Compare June 3, 2024 04:54
providers/os/resources/os.lr Show resolved Hide resolved
providers/os/resources/os.lr Outdated Show resolved Hide resolved
providers/os/resources/os.lr Outdated Show resolved Hide resolved
providers/os/resources/os.lr Outdated Show resolved Hide resolved
Signed-off-by: Christian Zunker <christian@mondoo.com>
providers/os/resources/os.lr.manifest.yaml Outdated Show resolved Hide resolved
providers/os/resources/os.lr.manifest.yaml Outdated Show resolved Hide resolved
providers/os/resources/os.lr.manifest.yaml Outdated Show resolved Hide resolved
providers/os/resources/os.lr.manifest.yaml Outdated Show resolved Hide resolved
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @czunker

@czunker czunker merged commit c81339d into main Jun 3, 2024
7 checks passed
@czunker czunker deleted the czunker/win_opt_feature branch June 3, 2024 09:18
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants