ChrisTitusTech / ChrisTitusTech/powershell-profile

Profile Error under PowerShell 5,1

Open Beginner friendly
#214 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
1k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

Summary

Profile has an error when loading under PowerShell 5.1.

Steps to reproduce
  1. Open PowerShell
  2. Run
  3. Observe error
Expected behavior

No error.

Actual behavior

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Set-Alias : The AllScope option cannot be removed from the alias 'gp'.
At C:\Users\effadj\OneDrive - Abbott\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:781 char:1

  • Set-Alias -Name gp -Value gpush -Force
  •   + CategoryInfo          : WriteError: (gp:String) [Set-Alias], SessionStateUnauthorizedAccessException
      + FullyQualifiedErrorId : AliasAllScopeOptionCannotBeRemoved,Microsoft.PowerShell.Commands.SetAliasCommand
    
    

Use 'Show-Help' to display help
Loading personal and system profiles took 2969ms.

OS

Windows 11 Enterprise 25H2 (OS Build 26200.9278)

PowerShell version

5.1.26100.9278

Logs or screenshots

Set-Alias : The AllScope option cannot be removed from the alias 'gp'.
At C:\Users\effadj\OneDrive - Abbott\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:781 char:1

  • Set-Alias -Name gp -Value gpush -Force
  •   + CategoryInfo          : WriteError: (gp:String) [Set-Alias], SessionStateUnauthorizedAccessException
      + FullyQualifiedErrorId : AliasAllScopeOptionCannotBeRemoved,Microsoft.PowerShell.Commands.SetAliasCommand

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the profile code that defines the gp alias and compare its Set-Alias behavior with PowerShell 5.1. Reproduce the profile load under PowerShell 5.1 and verify that the profile loads without the AllScope error while preserving the intended gp alias.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.