首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏运维开发王义杰

    Windows:PowerShell PSReadLine 模块及其命令历史维护

    为了增强用户体验,PowerShell 引入了 PSReadLine 模块。PSReadLine 提供了先进的命令行编辑和历史记录功能,使得在命令行环境中工作更加高效和便捷。 什么是 PSReadLine 模块 PSReadLine 是一个开源的 PowerShell 模块,旨在提供一个更好的命令行编辑器。 安装和加载 PSReadLine 模块 在 Windows 10 和更高版本中,PSReadLine 模块通常是预装的。 模块: powershell Import-Module PSReadLine PSReadLine 的基本配置 PSReadLine 提供了多种配置选项,可以通过 Set-PSReadLineOption \PSReadLine\ConsoleHost_history.txt" 搜索历史命令 PSReadLine 允许用户快速搜索历史命令。

    1.6K10编辑于 2024-07-31
  • 来自专栏Windows技术交流

    清理powershell历史记录

    Delete((Get-PSReadLineOption).HistorySavePath)Remove-Item "$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine ConsoleHost_history.txt" -ForceGet-ChildItem "C:\Users\*\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine Get-PSReadLineOption -EA Stop|Select -Exp HistorySavePath}catch{}}else{"$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine

    83210编辑于 2025-03-10
  • 来自专栏FreeBuf

    如何获得PowerShell命令的历史记录

    SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{57E5A8BB-41EB-4F09-B332-B535C5954A28} /f (2)安装PSReadLine 通过安装-模块命令安装: Install-Module -Name PSReadLine 弹出提示: NuGet provider is required to continue PowerShellGet Help (default is "Y"): 再次需要输入侧Y进行安装 如果需要实现一键安装,可以先安装的NuGet,再安装PSReadLine,完整命令如下: Install-PackageProvider (3)使用 所有的PowerShell命令将会保存在固定位置:%appdata%\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt 如果系统是Powershell v3或Powershell v4,可通过命令行安装PSReadLine,这样就能记录后续系统所有的Powershell命令。

    15.2K30发布于 2019-09-03
  • 来自专栏科控自动化

    打造一个华丽又实用的 PowerShell / Bash 命令输入环境

    安裝 PSReadLine 模組 優化 PowerShell 環境的利器,不過只能在 PowerShell 7 執行: Install-Module PSReadLine -AllowPrerelease GetDirectoryName($PROFILE))if (-not (Test-Path -Path $PROFILE -PathType Leaf)) { New-Item $PROFILE -Force} 啟用 PSReadLine 並啟用超強自動完成功能 你可以直接將我的 PROFILE_PSReadLine.ps1 內容加入到 PROFILE 啟動設定檔中! gist.githubusercontent.com/doggy8088/d3f3925452e2d7b923d01142f755d2ae/raw/aabe600ed2adccb43165228b8c8ced6e88ac9fc0/$PROFILE_PSReadLine.ps1

    81411编辑于 2024-04-18
  • 来自专栏网络安全技术点滴分享

    PowerShell历史记录防御规避新技术解析

    该功能由PSReadline模块提供,虽然从用户体验角度很有帮助,但也可能被黑客利用。 为解决此问题,PSReadline模块v2.0.4+版本引入敏感词过滤机制,当命令行包含以下关键词时将跳过历史记录(详情参见):PasswordAsplaintextTokenApikeySecretPowerShell v7.0.11+默认搭载支持此功能的PSReadline版本,而Windows PowerShell 5.1预装的PSReadline v2.0.0不支持该功能(但可手动更新)。

    25310编辑于 2025-08-20
  • 来自专栏每周聚焦

    Windows 11和vscode终端美化

    安装PSReadLinePSReadLine:github.com/PowerShell/… PSReadLine模块取代了 PowerShell 版本 3 及更高版本的命令行编辑体验。 上面是github里的介绍,但其实我们主要用到PSReadLine的功能就是自动保存历史记录,敲过一个命令后,后面只需要敲前几个字母就能提示出命令,按【→】键就可以自动补全命令语法着色 PSReadLine 4.1 安装PSReadLine以管理员身份运行Windows Terminal,执行下面命令:Install-Module PSReadLine -Force复制代码没有以管理员身份运行Windows -AllowPrerelease来安装PSReadLine? # 先安装PowerShellGetInstall-Module -Name PowerShellGet -Force# 然后再这条命令安装PSReadLineInstall-Module PSReadLine

    4.2K30编辑于 2022-07-22
  • 来自专栏网络安全技术点滴分享

    PowerShell哈希验证与历史记录渗透技术解析

    DRCheck-LocalAdminHash是一款新型PowerShell脚本,可针对多台主机验证密码哈希是否为有效的管理员凭证,并能够从该凭证具有管理员权限的所有系统中提取每个配置文件下的所有PowerShell PSReadline :https://github.com/dafthack/Check-LocalAdminHash历史记录收集需求在最近的一次评估中,我需要收集网络中所有系统的PowerShell控制台历史记录文件(PSReadline PSReadline控制台历史记录本质上是PowerShell版本的bash历史记录。 模块获取域中所有计算机列表利用Kevin Robertson的Invoke-TheHash工具进行哈希传递认证通过Invoke-WMIExec连接每个主机并执行编码的PowerShell命令发现系统所有配置文件中的PSReadline testdomain.local -Username PossibleAdminUser -PasswordHash E62830DAED8DBEA4ACD0B99D682946BB -AllSystems渗透所有PSReadline

    21210编辑于 2025-09-01
  • 来自专栏DevOps

    【转】Windows命令行代码自动补全详细步骤

    在 Windows 上,我们也可以打造类似体验,利用 PowerShell 7 + Oh My Posh + PSReadLine + posh-git,并让 VS Code 终端完美适配。 安装完之后到设置如果看不到PowerShell 7,那么手动添加一个配置文件三、安装 Oh My Posh、posh-git 和 PSReadLine在 PowerShell 7 中执行:# 更新 PowerShellGetInstall-Module JanDeDobbeleer.OhMyPosh -s winget# 安装 posh-git(Git 自动补全)Install-Module posh-git -Scope CurrentUser -Force# 安装 PSReadLine (增强自动补全)Install-Module PSReadLine四、修改 PowerShell 配置文件PowerShell 配置文件路径:$PROFILE可以用 VS Code 打开:code $PROFILE

    1400编辑于 2026-04-13
  • 来自专栏前端资源

    Powershell增强:命令补全、主题美化及Git扩展保姆级教程

    本文将介绍如何使用 PSReadLine 、oh-my-posh 和 posh-git 这三个模块来为 PowerShell 带来类似于 Mac 上的 oh my zsh 的体验,包括语法高亮、错误提示 查看已安装的模块 Get-InstalledModule 安装 PSReadLine PSReadLine 提供了语法高亮、错误提示、多行编辑、键绑定、历史记录搜索等功能: Install-Module  PSReadLine 安装 posh-git posh-git 可以在 PowerShell 中显示 Git 状态信息,并提供 Git 命令的自动补全: Install-Module posh-git -------------- Import Modules BEGIN ------------------------------- # 引入 ps-read-line Import-Module PSReadLine 总结 本文介绍了如何使用 PSReadLine 、oh-my-posh 和 posh-git 这三个模块来为 PowerShell 打造个性化的命令行体验,包括语法高亮、错误提示、多行编辑、键盘绑定、自动补全

    15.2K41编辑于 2023-08-25
  • 来自专栏szhshp 的第四边境中转站

    尝试 Windows Terminal + z.lua

    因为最终我们是通过 Windows Terminal 启动 Powershell 插件安装 使用 PowerShell, 执行下面的命令分别安装 Posh-Git 和 Oh-My-Posh: # PSReadline - 实现类似 ZSH 那样的命令补全 Install-Module -Name PSReadLine -Scope CurrentUser # posh-git - Git 插件 Install-Module Import Modules ======================= Import-Module posh-git Import-Module oh-my-posh Import-Module PSReadLine 也可以另外开启一个 Terminal 输入`Get-PoshThemes` 来直接查看所有主题 Set-Theme marcduiker # ========================= PSReadLine

    1.7K20编辑于 2022-09-21
  • 来自专栏漫漫全栈路

    Powershell 美化和 Win 包管理工具

    Install-Module posh-git -Scope CurrentUser Install-Module oh-my-posh -Scope CurrentUser 如果在PS Core上运行此功能,请确保已经安装PSReadLine 的2.0.0-beta1版本 Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck

    2.1K10发布于 2019-12-04
  • 来自专栏DevOps

    PowerShell 7.x 的自定义设置

    winget install Microsoft.PowerShell也可以去官网下载powershell ,目前官网推荐的版本是 7.x安装 PowerShell 扩展模块Install-Module PSReadLine ,为了方便使用还自定义一个名为 'cc' 的函数别名function cc { claude --dangerously-skip-permissions @args}# ---------- PSReadLine

    23910编辑于 2026-04-15
  • 来自专栏Windows技术交流

    渲染业务镜像优化

    >%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt" 2>$null HistorySavePath 2>$null clear-history cmd.exe /c "del %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline >%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt" 2>$null HistorySavePath 2>$null;clear-history;cmd.exe /c "del %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline

    95850编辑于 2024-10-28
  • 来自专栏张善友的专栏

    CentOS 7 上面安装PowerShell

    Microsoft.PowerShell.Management Get-PSSession Cmdlet Microsoft.PowerShell.Core Get-PSReadlineOption Cmdlet PSReadLine Get-PSReadlineKeyHandler Cmdlet PSReadLine Get-PSProvider Cmdlet Microsoft.PowerShell.Management Get-PSHostProcessInfo Microsoft.PowerShell.Core Set-PSSessionConfiguration Cmdlet Microsoft.PowerShell.Core Set-PSReadlineOption Cmdlet PSReadLine Set-PSReadlineKeyHandler Cmdlet PSReadLine Set-PSDebug Cmdlet Microsoft.PowerShell.Core Set-PSBreakpoint Publish-Script Function PowerShellGet Publish-Module Function PowerShellGet PSConsoleHostReadline Function PSReadLine

    1.9K80发布于 2018-01-19
  • 来自专栏前端开发

    windows中使用Oh My Posh美化你的终端PowerShell或CMD

    POSH_THEMES_PATH\montys.omp.json | Invoke-Expression Import-Module posh-git # 引入 posh-git Import-Module PSReadLine 首先在 PowerShell 执行以下命令安装插件: Install-Module -Name PowerShellGet -Force Install-Module PSReadLine -AllowPrerelease -Force 然后修改前面的配置文件 Microsoft.PowerShell_profile.ps1,在末尾追加以下内容: Import-Module PSReadLine # 历史命令联想 #

    9.3K10编辑于 2024-08-06
  • 来自专栏码农小胖哥的码农生涯

    手把手教你美化微软的新终端Windows Terminal

    如果使用的是PowerShell Core,请安装PSReadline: Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

    7.4K10发布于 2020-07-02
  • 来自专栏红队蓝军

    浅谈命令混淆

    powershell命令历史记录,如果命令用不起,可以查看powershell的txt %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline \ConsoleHost_history.txt %appdata%\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt 注册表

    86810编辑于 2022-05-17
  • 来自专栏数值分析与有限元编程

    配置高颜值的Windows Terminal

    如图所示,分别输入命令Install-Module -Name PSReadLine Install-Module oh-my-posh 。

    2K42发布于 2021-08-20
  • 来自专栏FreeBuf

    Hack The Box,一款有意思的渗透测试平台

    exe 运行该文件,找到一个历史文件: 下载该文件: download C:\Users\legacyy\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine

    1.7K20编辑于 2022-11-14
  • 来自专栏FreeBuf

    使用TScopy访问已锁定的文件

    Microsoft\Windows\Recent,c:\windows\system32\config,c:\users\*\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine

    1.3K30发布于 2021-05-20
领券