PowerShell / PowerShell/PowerShell
Constrained Language Audit Mode blocking actions
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 88
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
start-job -ScriptBlock {Get-ChildItem} #Will result in an error that the language mode is incompatible with the system-wide language mode $executionContext.SessionState.LanguageMode = "FullLanguage" #Would not be possible if Constrained language mode was enforced, but succeeds start-job -ScriptBlock {Get-ChildItem} #Succeeds
Expected behavior
1 Job1 BackgroundJob Running True localhost Get-ChildItem
Actual behavior
Start-Job: Cannot start job. The language mode for this session is incompatible with the system-wide language mode.
Error details
Start-Job: Cannot start job. The language mode for this session is incompatible with the system-wide language mode.
Environment data
Name Value
---- -----
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
Constrained language audit mode seems to block commands. I would expect audit mode to log but not enforce anything. Using start-job as an example, the command fails with "The language mode for this session is incompatible with the system-wide language mode."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduced Start-Job failure and the SessionState.LanguageMode assignment described in the issue. Verify behavior with the supplied commands under constrained language audit mode, then confirm that audit mode records the event without blocking Start-Job while enforced constrained language behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, shell
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100