Comments (7)
I was just able to fix this on my system. Defender completely deletes that ConsoleMode.ps1 file no matter where it is created, including during reinstall, which made things a challenge. Here are the steps I needed to get back to working again.
- Add exclusion to parent folder to allow you to install the new ConsoleMode.ps1 in the future:
C:\Users\{username}\Documents\PowerShell\Modules\posh-git\1.1.0\
- Add exclusion to the entire Temp folder where the posh-git installer will create the same file when you try to reinstall:
C:\Users\{username}\AppData\Local\Temp\
. - Reinstall posh-git:
PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
- Remove exclusion for entire Temp folder, since that's probably a bit too expansive. (You need to keep the first exclusion in place until Defender stops trying to delete ConsoleMode.ps1 every time.)
from posh-git.
from posh-git.
As a workaround you can add an exclusion in Windows Security for that specific file, though that does potentially weaken the security of your Windows device.
from posh-git.
Not that it helps, but this appears to be a botched Defender definition that went out. It appears to affect all sorts of things, like this issue as well as deleting all app shortcuts in the task bar. Here's a thread about it on Reddit.
https://www.reddit.com/r/sysadmin/comments/10ar1vb/multiple_users_reporting_microsoft_apps_have/
And here's an acknowledgement from the M365 folks.
https://twitter.com/MSFT365Status/status/1613871552256155649
from posh-git.
Thanks, Adam, @patridge. This worked for me. For those who don't know how to add an exclusion, use the following command:
Add-MpPreference -AttackSurfaceReductionOnlyExclusions "[PATH]"
from posh-git.
Ooh...I wonder if that would allow you to preemptively add non-existent files that you plan to have exist soon. That would prevent needing to add exemptions that are more broad than strictly necessary.
Oddly, adding via that system doesn't appear to surface them in the Exclusions page of the Security section of the Windows Settings app. I wonder where those get stored.
from posh-git.
Yes, it would. You can add both files and folders to the exception.
from posh-git.
Related Issues (20)
- VSCode shell integration disables posh-git prompt HOT 2
- Powershell 7.3.0 does not show posh-git status bar HOT 7
- Set back to default
- Tab competition: tab vs right arrow HOT 5
- Bring back Get-GitBranch HOT 2
- Suggestion: Implement a PSReadLine completion provider
- git ls-remote won't prompt
- Prompt not appearing. Cmder/ConEmu, Windows 11 arm64 on M1 MacBook Pro under UTM. HOT 7
- Intellisense works on commands that don't exist
- Error when pushing to Bitbucket server HOT 2
- posh-git doesn't work with vscode integrated terminal HOT 5
- posh-git: The term 'posh-git' is not recognized as a name of a cmdlet, function, script file, or executable program. HOT 1
- Calling git on module import could be avoided HOT 2
- Tests break when run under the pwsh 7.3
- Importing posh-git shows empty prompt
- Request: Add -NoANSI option to all Write-commands
- Install fails while retrieving member "TryParse" as it violates the constraint of type 'T1' HOT 3
- posh-git is slow when navigating inside a Git LFS-enabled repository containing multiple gigabyte-sized files.
- $GitPromptSettings.UntrackedFilesMode="Defaul" doesn't respect git config for untracked files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from posh-git.