
pwsh
永。。3
这个作者很懒,什么都没留下…
展开
-
powershell 按F7展开搜索历史记录
Install-Module Microsoft.PowerShell.ConsoleGuiToolscode $profile添加一下代码# 按f7显示历史记录function ocgv_history { $line = $null $cursor = $null [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor) $selection = $input | Out.原创 2021-09-03 00:16:36 · 1080 阅读 · 0 评论 -
powershell tab键下拉菜单智能提示
基于PSReadLine 得智能提示, tab健下拉菜单下载依赖Install-Module -Name GuiCompletion注册tab按键Install-GuiCompletion -Key Tab或者自定义按键Set-PSReadlineKeyHandler -Key Alt+Spacebar -ScriptBlock { Invoke-GuiCompletion }原创 2021-09-02 23:57:55 · 1040 阅读 · 1 评论 -
powershell 小数计算
js的小数加减乘除的结果console.log(1.0 - 0.9);// 0.09999999999999998console.log(0.3 / 0.1);// 2.9999999999999996console.log(9.7 * 100);// 969.9999999999999console.log(2.22 + 0.1);// 2.3200000000000003python小数计算 结果0.1 + 0.2# 0.30000000000000004powers原创 2021-09-02 18:16:34 · 637 阅读 · 0 评论 -
powershell 操作sqlite数据库 增删改查(windows)
先安装install-module sqlite执行以下demo.ps1文件import-module SQLitefunction mount-db { New-PSDrive -PSProvider SQLite -Name db -Root "Data Source=file::memory:,Version=3,New=true" -Scope global | Out-Null; New-Item -path db:/data -Value @{ id = 'INTEGER PR原创 2021-08-26 22:18:51 · 735 阅读 · 0 评论 -
start-job pwsh的后台任务文档-案例(机译)
语法Start-Job [-Name <String>] [-ScriptBlock] <ScriptBlock> [-Credential <PSCredential>] [-Authentication <AuthenticationMechanism>] [[-InitializationScript] <ScriptBlock>] [-WorkingDirectory <S翻译 2021-08-26 18:48:53 · 665 阅读 · 0 评论 -
powershell 命令行配置, 执行耗时,当前分支, 智能提示,智能识别跳转路径
实现效果, 提示上一条的耗时, 当前事件, 当前git分支, 当前路径z 自动识别路径调整, 命令行智能提示code $profile# 下载zoxide; https://github.com/ajeetdsouza/zoxideInvoke-Expression (& { $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' } (zoxide init --hook $原创 2021-08-21 10:19:59 · 285 阅读 · 0 评论 -
pwsh的 二维数组的属性方法获取
$a = New-Object 'object[,]' 2,2 # 2-D array of length 4 $a[0,0] = 10 $a[0,1] = $false $a[1,0] = "red" $a[1,1] = $nullgm -inputObject $aget-member -InputObject $a$b = (New-Object 'int[,]' 2,2) $b[0,0] = 10 $b[0,1] = 20 $b[1,0] = 30 $b[1,1] = 40原创 2021-05-29 10:50:32 · 281 阅读 · 0 评论