An Issue Reproduction for Conflicts with PowerShell
This document provides steps to reproduce an issue that occurs in the following repository:
Reproduction Steps
Install
ni
package globally.shnpm install -g @antfu/ni
当我把 脚本 添加到我的
PowerShell
配置文件中,尝试修复Conflicts with PowerShell
:shif (-not (Test-Path $profile)) { New-Item -ItemType File -Path (Split-Path $profile) -Force -Name (Split-Path $profile -Leaf) } $profileEntry = 'Remove-Item Alias:ni -Force -ErrorAction Ignore' $profileContent = Get-Content $profile if ($profileContent -notcontains $profileEntry) { $profileEntry | Out-File $profile -Append -Force }
配置在我本地的
C:\Users\admin\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
中时,我的VSCode
终端却是这样的:而且之前配置的脚本多了这样的文字:
但是,在当我去掉
$profileEntry
的单引号之后,就恢复了正常。