{ "version": "https://jsonfeed.org/version/1", "title": "PowerShell", "description": "Windows PowerShell is Microsoft's task automation and configuration management framework, consisting of a command-line shell and associated scripting language built on .NET Framework.", "home_page_url": "go/powershell", "feed_url": "feed/powershell.json", "icon": "https://cdn.v2ex.com/navatar/8c67/44c9/776_large.png?m=1559640109", "favicon": "https://cdn.v2ex.com/navatar/8c67/44c9/776_normal.png?m=1559640109", "items": [ { "author": { "url": "member/Apol1oBelvedere", "name": "Apol1oBelvedere", "avatar": "https://cdn.v2ex.com/avatar/3eaa/16c7/380208_large.png?m=1760590534" }, "url": "t/1090083", "date_modified": "2024-11-16T06:39:40+00:00", "content_html": "

\u6c42\u52a9\u5728 Windows \u684c\u9762\u8fd0\u884c\u67d0\u4e2a\u7a0b\u5e8f\u7684\u591a\u4e2a\u5b9e\u4f8b\u5e76\u5728\u6574\u4e2a\u7a7f\u591f\u5c4f\u5e55\u6309 2 \u884c n \u5217\u5e03\u5c40\u5e03\u6ee1\u7684 powershell \u811a\u672c\uff0c\u6211\u7528 GPT \u751f\u6210\u7684 powershell \u811a\u672c\u4e5f\u65e0\u6cd5\u5e73\u94fa\uff0c\u4e5f\u662f\u4f4d\u7f6e\u968f\u673a\u7684\u3002\n\u64cd\u4f5c\u7cfb\u7edf\uff1aWindows 11 24H2\n\u8fd0\u884c\u5e73\u53f0\uff1aPowerShell \uff0cCMD \u7ec8\u7aef\u4e0d\u5177\u5907\u8bbe\u7f6e\u7a97\u53e3\u5927\u5c0f\u548c\u4f4d\u7f6e\u7684\u529f\u80fd\u3002\n\u8fd0\u884c\u6548\u679c\uff1a

\n
    \n
  1. \u63d0\u793a\u8f93\u5165\u9700\u8981\u8fd0\u884c\u7a0b\u5e8f\u7684\u6570\u91cf\u3002
  2. \n
  3. \u76f4\u63a5\u5728\u811a\u672c\u91cc\u624b\u5de5\u8bbe\u7f6e\u7a0b\u5e8f\u4f4d\u7f6e\u4ee5\u4fbf\u56fa\u5b9a\u540e\u957f\u671f\u4f7f\u7528\u3002
  4. \n
  5. \u811a\u672c\u81ea\u52a8\u83b7\u53d6\u5c4f\u5e55\u5206\u8fa8\u7387\u3002
  6. \n
  7. \u4f8b\u5982 6 \u4e2a\u7a97\u53e3\u6253\u5f00\u540e\uff0c\u811a\u672c\u81ea\u52a8\u8ba1\u7b97\u7a97\u53e3\u5927\u5c0f\u548c\u4f4d\u7f6e\uff0c\u628a\u7a97\u53e3\u653e\u7f6e\u597d\uff0c\u7a97\u53e3\u5927\u5c0f\u76f8\u7b49\uff0c2 \u884c n \u5217\u5e03\u5c40\u3002
  8. \n
  9. \u4ee5\u8bb0\u4e8b\u672c\u4e3a\u4f8b\uff0c\u80fd\u786e\u5b9e\u8fd0\u884c\u7b26\u5408\u6548\u679c\u3002
  10. \n
\n", "date_published": "2024-11-16T06:38:20+00:00", "title": "\u6c42\u52a9\u5728 Windows \u684c\u9762\u8fd0\u884c\u67d0\u4e2a\u7a0b\u5e8f\u7684\u591a\u4e2a\u5b9e\u4f8b\u5e76\u5728\u6574\u4e2a\u7a7f\u591f\u5c4f\u5e55\u5e03\u6ee1\u7684 powershell \u811a\u672c\uff0c GPT \u751f\u6210\u7684\u4e5f\u65e0\u6cd5\u5e73\u94fa\u4f4d\u7f6e\u968f\u673a\u7684\u3002", "id": "t/1090083" }, { "author": { "url": "member/FYFX", "name": "FYFX", "avatar": "https://cdn.v2ex.com/avatar/25b4/8c4f/198487_large.png?m=1760501239" }, "url": "t/1021188", "date_modified": "2024-03-07T00:20:41+00:00", "content_html": "

\u6700\u8fd1\u4ece linux \u6362\u4f1a windows,\u611f\u89c9 powershell \u91cc\u9762\u53cd\u659c\u6760\u6709\u70b9\u4e0d\u723d\uff0c\u540e\u9762\u67e5\u4e86\u4e00\u4e0b pwsh \u662f\u652f\u6301\u987a\u659c\u6760\u7684\uff0c\u4e0d\u8fc7 tab \u8865\u5168\u662f\u53cd\u659c\u6760\uff0c\u7136\u540e\u5728 github \u4e0a\u9762\u4e5f\u627e\u5230\u4e86\u5c06 tab \u8865\u5168\u6539\u6210\u659c\u6760\u7684\u8bbe\u7f6e

\n
Set-PSReadLineKeyHandler -Chord Tab -ViMode Command -ScriptBlock {\n $cOntent= \"\"\n $index = 0\n\n [Microsoft.PowerShell.PSConsoleReadLine]::ViTabCompleteNext()\n [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref] $content, [ref] $index)\n [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()\n [Microsoft.PowerShell.PSConsoleReadLine]::Insert($content.Replace('\\','/'))\n [Microsoft.PowerShell.PSConsoleReadLine]::SetCursorPosition($index)\n}\n
\n

\u94fe\u63a5\u662f\u8fd9\u4e2a: https://github.com/PowerShell/PSReadLine/issues/3205

\n

cd \u8fd8\u6709\u6267\u884c\u7a0b\u5e8f\u548c.ps1 \u811a\u672c\u90fd\u6ca1\u5565\u95ee\u9898\uff0c\u4e0d\u8fc7\u6211\u4e5f\u624d\u7528\uff0c\u53ef\u80fd\u4f1a\u5f71\u54cd\u4e00\u4e9b\u7528\u5230 cmd \u5de5\u5177\u7684\u547d\u4ee4?

\n", "date_published": "2024-03-06T09:34:24+00:00", "title": "\u662f\u6211\u5b64\u964b\u5be1\u95fb\u4e86\u5417? powershell \u91cc\u9762\u5176\u5b9e\u652f\u6301\u987a\u659c\u6760\uff0c tab \u8865\u5168\u4e5f\u80fd\u6539\u6210\u987a\u659c\u6760", "id": "t/1021188" }, { "author": { "url": "member/KIMI360", "name": "KIMI360", "avatar": "https://cdn.v2ex.com/avatar/b2f1/234b/34884_large.png?m=1707356485" }, "url": "t/1014989", "title": "\u6c42\u52a9\uff1a\u5982\u4f55\u963b\u6b62 Powershell \u751f\u6210 tmp \u6587\u4ef6", "id": "t/1014989", "date_published": "2024-02-08T01:41:54+00:00", "content_html": "

\u6700\u8fd1\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528 powershell \u975e\u5e38\u5361\uff0c\u52a0\u8f7d\u6162\uff0c\u8f93\u5165\u547d\u4ee4\u6162\uff0c\u8fd4\u56de\u4e5f\u6162\u3002\u7814\u7a76\u4e86\u4e00\u4e0b\u53d1\u73b0%TEMP%\u4e0b\u5b58\u5728\u5927\u91cf PS \u5f00\u5934\u7684.tmp \u6587\u4ef6\uff0c\u5220\u9664\u540e powershell \u5c31\u6062\u590d\u6b63\u5e38\u4e86\u3002

\n

\u60f3\u5728 powershell \u5f00\u59cb\u524d\u4f7f\u7528\u547d\u4ee4\u5220\u9664\u8fd9\u4e9b tmp \u6587\u4ef6\uff0c\u7ed3\u679c\u6267\u884c\u547d\u4ee4\u65f6\u4e00\u8fb9\u5220\u9664\u4e00\u8fb9\u53c8\u751f\u6210\u4e86\u540c\u6837\u591a\u7684 tmp \u6587\u4ef6

\n
gci $env:TEMP\\PS*.tmp -File | % { ri $_.FullName -Force }\n
\n

\u90a3\u4e48\u73b0\u5728\u95ee\u9898\u6765\u4e86\uff0c\u5982\u4f55\u963b\u6b62 powershell \u751f\u6210\u8fd9\u4e9b\u6587\u4ef6\u5462

\n" }, { "author": { "url": "member/bddxg", "name": "bddxg", "avatar": "https://cdn.v2ex.com/avatar/5625/e5b5/528202_large.png?m=1717375989" }, "url": "t/1008646", "date_modified": "2024-01-15T11:38:28+00:00", "content_html": "

\u6211\u81ea\u5df1\u627e\u5230\u4e86\u4e00\u4e9b\u8bbe\u7f6e\u522b\u540d\u7684\u6559\u7a0b\u6587\u7ae0\n\u6bd4\u5982 https://segmentfault.com/a/1190000015928399\n\u4f46\u662f\u6211\u76ee\u524d\u9047\u5230\u4e86\u4e00\u4e2a\u96be\u9898, \u53ef\u80fd\u662f\u6211\u7684\u7406\u89e3\u4e0d\u591f

\n

\u6211\u6709\u4e2a\u957f\u547d\u4ee4 pnpm store prune, \u6211\u5e0c\u671b\u80fd\u7528pmsp \u6765\u66ff\u4ee3\u8fd9\u4e2a\u547d\u4ee4\n\u6211\u4e0d\u77e5\u9053\u8be5\u5982\u4f55\u8bbe\u7f6e\n\u6211\u5c1d\u8bd5\u8fc7

\n
Set-Alias -Name pmsp -Value \"pnpm store prune\"\nSet-Alias pmsp \"pnpm store prune\"\nSet-Alias pmsp pnpm store prune\n
\n

\u4ee5\u4e0a\u90fd\u4e0d\u884c,\u8981\u4e48\u76f4\u63a5\u6253\u5f00\u7ec8\u7aef\u5c31\u62a5\u9519, \u8981\u4e48\u6267\u884c pmsp \u7684\u65f6\u5019\u63d0\u793a\u65e0\u6cd5\u5c06\u201cpnpm store prune\u201d\u9879\u8bc6\u522b\u4e3a cmdlet \u3001\u51fd\u6570\u3001\u811a\u672c\u6587\u4ef6\u6216\u53ef\u8fd0\u884c\u7a0b\u5e8f\u7684\u540d\u79f0

\n

\u6c42\u5927\u4f6c\u6307\u6559\u4e00\u4e0b

\n", "date_published": "2024-01-15T01:10:41+00:00", "title": "\u8bf7\u6559 win11 powershell \u8bbe\u7f6e\u522b\u540d\u7684\u95ee\u9898", "id": "t/1008646" }, { "author": { "url": "member/xinghen57", "name": "xinghen57", "avatar": "https://cdn.v2ex.com/gravatar/49898a022667beb29951a580b31eeb9c?s=73&d=retro" }, "url": "t/999636", "title": "\u5982\u4f55\u786e\u5b9a powershell \u5728\u7ec8\u7aef\u8f93\u51fa\u7684\u4fe1\u606f\u662f stdout \u8fd8\u662f stderr\uff1f", "id": "t/999636", "date_published": "2023-12-12T03:36:02+00:00", "content_html": "

\u6700\u8fd1 powershell \u4e2d\u7528 ffmpeg \uff0c\u53d1\u73b0\u5b83\u7ec8\u7aef\u7684\u8f93\u51fa\u7adf\u7136\u8d70\u7684 stderr \u3002

\n

\u8bf7\u95ee v \u53cb\uff0c\u6709\u65b9\u6cd5\u786e\u8ba4\u7ec8\u7aef\u8f93\u51fa\u662f stdout \u8fd8\u662f stderr \u5417\uff1f\u6216\u786e\u5b9a\u7ec8\u7aef\u8f93\u51fa\u7684 stream \u53f7\uff1f

\n" }, { "author": { "url": "member/n2l", "name": "n2l", "avatar": "https://cdn.v2ex.com/avatar/fc64/6dae/253420_large.png?m=1773899890" }, "url": "t/996454", "date_modified": "2023-11-30T10:55:07+00:00", "content_html": "", "date_published": "2023-11-30T02:44:06+00:00", "title": "ps1 \u6587\u4ef6\u5982\u4f55\u53cc\u51fb\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c", "id": "t/996454" }, { "author": { "url": "member/n2l", "name": "n2l", "avatar": "https://cdn.v2ex.com/avatar/fc64/6dae/253420_large.png?m=1773899890" }, "url": "t/991270", "date_modified": "2023-11-13T00:03:56+00:00", "content_html": "\u7528\u7684 v2rayN \uff0c\u4e34\u65f6\u8bbe\u7f6e http_proxy \u7684\u65b9\u5f0f\u5728 cmd \u662f\u53ef\u884c\u7684\uff0c\u5728 powershell \u4e0a\u6b7b\u6d3b\u5c31\u662f\u4ee3\u7406\u4e0d\u4e0a\uff0c\u6c42\u6551\u3002", "date_published": "2023-11-12T14:25:14+00:00", "title": "powershell \u600e\u4e48\u8bbe\u7f6e\u4ee3\u7406\uff1f", "id": "t/991270" }, { "author": { "url": "member/laminux29", "name": "laminux29", "avatar": "https://cdn.v2ex.com/gravatar/f5dac702f2936e95d543670f76649f23?s=73&d=retro" }, "url": "t/991168", "date_modified": "2023-11-13T00:07:15+00:00", "content_html": "mkfifo test-fifo

bash < test-fifo

\u7528 ps -ef | grep bash \u5c31\u65e0\u6cd5\u627e\u5230 bash < test-fifo \u8fd9\u6761\u5b8c\u6574\u547d\u4ee4\u3002

\u8bf7\u95ee\u8fd9\u662f bug \u5417\uff1f\u8fd8\u662f\u6211\u7684\u59ff\u52bf\u4e0d\u5bf9\uff1f", "date_published": "2023-11-12T07:08:45+00:00", "title": "ps \u65e0\u6cd5\u663e\u793a bash \u547d\u4ee4\u7684\u5b8c\u6574\u53c2\u6570\uff0c\u662f bug \u5417\uff1f", "id": "t/991168" }, { "author": { "url": "member/zzzkkk", "name": "zzzkkk", "avatar": "https://cdn.v2ex.com/gravatar/6e3e74eddd50888ba6210566f0669c97?s=73&d=retro" }, "url": "t/978793", "date_modified": "2023-10-03T17:29:56+00:00", "content_html": "setx classpath \".;Lombok.jar\"

echo %classpath% \u65e0\u6cd5\u5f97\u5230\u503c

\u5728 cmd.exe \u91cc\u9762\u80fd\u5f97\u5230\u521a\u8bbe\u7f6e\u7684\u503c", "date_published": "2023-10-03T15:53:31+00:00", "title": "powershell setx \u53d8\u91cf\u540e\u65e0\u6cd5\u81ea\u8eab\u5f97\u5230\u53d8\u91cf\u503c", "id": "t/978793" }, { "author": { "url": "member/purezhang", "name": "purezhang", "avatar": "https://cdn.v2ex.com/avatar/9426/7422/109182_large.png?m=1429881150" }, "url": "t/974143", "title": "\u8bf7\u6559\uff0c powershell \u811a\u672c\u4e2d\u4f7f\u7528\u4e2d\u6587\uff0c\u811a\u672c\u6587\u672c\u5b58\u50a8\u7684\u662f utf-8\uff0c\u8fd0\u884c\u540e\u4e2d\u6587\u5c31\u662f\u4e71\u7801\u3002", "id": "t/974143", "date_published": "2023-09-15T07:51:17+00:00", "content_html": "

\u8bf7\u6559\uff0cpowershell \u811a\u672c\u4e2d\u4f7f\u7528\u4e2d\u6587\uff0c\u811a\u672c\u6587\u672c\u5b58\u50a8\u7684\u662f utf-8 \uff0c\u8fd0\u884c\u540e\u4e2d\u6587\u5c31\u662f\u4e71\u7801\u3002\n\u641e\u4e0d\u5b9a\u554a\u3002\u3002\u3002\u3002\u3002

\n" }, { "author": { "url": "member/mmddisa", "name": "mmddisa", "avatar": "https://cdn.v2ex.com/gravatar/61b5b8b742285bfc40526f1d8b3fa1e5?s=73&d=retro" }, "url": "t/956975", "date_modified": "2023-07-15T05:21:07+00:00", "content_html": "

\u5b89\u88c5 oh-my-posh \u540e\uff0cpowershell \u542f\u52a8\u5f02\u5e38\u7f13\u6162\uff0c\u4e14\u4f3c\u4e4e\u53d7\u7f51\u7edc\u5f71\u54cd\uff0c\u7f51\u7edc\u6b63\u5e38\u65f6\u542f\u52a8\u9700 1900ms \u5de6\u53f3\uff1a\n\"\"\n\u82e5\u5173\u95ed\u7f51\u7edc\uff0c\u5219\u9700\u8981 11 \u79d2\u8fd8\u591a\uff1a\n\"\"

\n

\u8bd5\u8fc7\u5c06 oh-my-posh \u52a0\u5165 windows defender \u7b49\u65b9\u6cd5\uff0c\u4f3c\u4e4e\u6ca1\u6709\u7528

\n

\u9644\u4e0a\u7f51\u7edc\u6b63\u5e38/\u65ad\u5f00\u65f6\u7684 Debug \u4fe1\u606f\uff1a

\n

\u7f51\u7edc\u6b63\u5e38\u65f6\uff1a

\n
Cache path: C:\\Users\\login\\AppData\\Local\\oh-my-posh\n\nConfig path: C:\\Users\\login\\AppData\\Local\\Programs\\oh-my-posh\\themes\\cert.omp.json\n\nLogs:\n\n[DEBUG] 13:06:43.411 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:06:43.411 shell.go:Getenv(TERM_PROGRAM) - 0s\n[DEBUG] 13:06:43.411 shell.go:Getenv:397 \u2192 C:\\Users\\login\\AppData\\Local\n[TRACE] 13:06:43.411 shell.go:Getenv(LOCALAPPDATA) - 0s\n[TRACE] 13:06:43.411 shell_windows.go:CachePath() - 0s\n[DEBUG] 13:06:43.412 shell.go:Getenv:397 \u2192 C:\\Users\\login\\AppData\\Local\\Programs\\oh-my-posh\\themes\\cert.omp.json\n[TRACE] 13:06:43.412 shell.go:Getenv(POSH_THEME) - 0s\n[DEBUG] 13:06:43.440 shell.go:Shell:644 \u2192 process name: pwsh.exe\n[TRACE] 13:06:43.440 shell.go:Shell() - 28.6409ms\n[TRACE] 13:06:43.440 shell.go:resolveConfigPath() - 28.6409ms\n[TRACE] 13:06:43.440 shell.go:Init() - 29.7168ms\n[TRACE] 13:06:43.440 shell.go:Flags() - 0s\n[TRACE] 13:06:43.441 config.go:loadConfig() - 523.2\u00b5s\n[TRACE] 13:06:43.441 shell.go:Flags() - 0s\n[DEBUG] 13:06:43.441 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:06:43.441 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s\n[TRACE] 13:06:43.441 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\DWM\\ColorizationColor) - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.441 shell_windows.go:WindowsRegistryKeyValue:206 \u2192 ColorizationColor(DWORD): 0xC40078D4\n[TRACE] 13:06:43.441 shell.go:Shell() - 0s\n[DEBUG] 13:06:43.441 shell.go:Getenv:397 \u2192 7.3.6\n[TRACE] 13:06:43.441 shell.go:Getenv(POSH_SHELL_VERSION) - 0s\n[DEBUG] 13:06:43.441 debug.go:PrintDebug:23 \u2192 Segment: Title\n[TRACE] 13:06:43.441 shell.go:Flags() - 0s\n[DEBUG] 13:06:43.441 block.go:Debug:280 \u2192 Segment: session\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.441 shell.go:Pwd:427 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.441 shell.go:Pwd() - 0s\n[DEBUG] 13:06:43.441 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.441 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.441 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:06:43.441 shell.go:Getenv(SSH_CONNECTION) - 0s\n[DEBUG] 13:06:43.441 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:06:43.441 shell.go:Getenv(SSH_CLIENT) - 0s\n[TRACE] 13:06:43.441 shell_windows.go:Root() - 0s\n[TRACE] 13:06:43.441 shell.go:Shell() - 0s\n[TRACE] 13:06:43.441 shell.go:ErrorCode() - 0s\n[TRACE] 13:06:43.441 shell_windows.go:IsWsl() - 0s\n[TRACE] 13:06:43.442 shell.go:Pwd() - 0s\n[DEBUG] 13:06:43.442 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.442 shell.go:User:548 \u2192 login\n[TRACE] 13:06:43.442 shell.go:User() - 0s\n[DEBUG] 13:06:43.442 shell.go:Host:560 \u2192 Avalon\n[TRACE] 13:06:43.442 shell.go:Host() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.442 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:06:43.442 shell.go:Getenv(SHLVL) - 0s\n[TRACE] 13:06:43.442 shell.go:TemplateCache() - 1.0664ms\n[TRACE] 13:06:43.442 shell.go:TemplateCache() - 0s\n[TRACE] 13:06:43.442 shell.go:Shell() - 0s\n[DEBUG] 13:06:43.442 block.go:Debug:280 \u2192 Segment: path\n[TRACE] 13:06:43.442 shell.go:Pwd() - 0s\n[DEBUG] 13:06:43.442 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:Pwd() - 0s\n[TRACE] 13:06:43.442 shell.go:Shell() - 0s\n[TRACE] 13:06:43.442 shell.go:Flags() - 0s\n[DEBUG] 13:06:43.442 properties.go:GetBool:22 \u2192 mapped_locations_enabled: true\n[DEBUG] 13:06:43.442 properties.go:GetString:28 \u2192 \uf013\n[DEBUG] 13:06:43.442 properties.go:GetString:28 \u2192 \uf013\n[DEBUG] 13:06:43.442 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.442 properties.go:GetString:28 \u2192 ~\n[DEBUG] 13:06:43.442 properties.go:GetKeyValueMap:46 \u2192 mapped_locations: map[]\n[TRACE] 13:06:43.442 shell.go:PathSeparator() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:PathSeparator() - 0s\n[TRACE] 13:06:43.442 shell.go:PathSeparator() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:PathSeparator() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:PathSeparator() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.442 shell.go:PathSeparator() - 0s\n[TRACE] 13:06:43.442 shell.go:Pwd() - 0s\n[TRACE] 13:06:43.442 shell_windows.go:IsWsl() - 0s\n[TRACE] 13:06:43.442 shell.go:StackCount() - 0s\n[DEBUG] 13:06:43.443 win32_windows.go:isWriteable:299 \u2192 not current user or in group\n[DEBUG] 13:06:43.443 win32_windows.go:isWriteable:303 \u2192 current user is member of S-1-5-32-544\n[DEBUG] 13:06:43.443 win32_windows.go:isWriteable:311 \u2193\n WRITE_DAC\n WRITE_OWNER\n SYNCHRONIZE\n DELETE\n READ_CONTROL\n[DEBUG] 13:06:43.443 win32_windows.go:isWriteable:313 \u2192 user has write access\n[TRACE] 13:06:43.443 shell_windows.go:DirIsWritable() - 524\u00b5s\n[TRACE] 13:06:43.443 shell.go:TemplateCache() - 0s\n[TRACE] 13:06:43.443 shell.go:TemplateCache() - 0s\n[TRACE] 13:06:43.443 shell.go:Shell() - 0s\n[DEBUG] 13:06:43.443 block.go:Debug:280 \u2192 Segment: git\n[TRACE] 13:06:43.443 shell.go:Pwd() - 0s\n[DEBUG] 13:06:43.443 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.443 shell.go:GOOS() - 0s\n[TRACE] 13:06:43.443 shell.go:GOOS() - 0s\n[ERROR] 13:06:43.447 shell.go:CommandPath:602 \u2192 exec: \"git.exe\": executable file not found in %PATH%\n[TRACE] 13:06:43.447 shell.go:CommandPath(git.exe) - 4.2052ms\n[TRACE] 13:06:43.447 shell.go:HasCommand(git.exe) - 4.2052ms\n[DEBUG] 13:06:43.447 block.go:Debug:280 \u2192 Segment: time\n[TRACE] 13:06:43.447 shell.go:Pwd() - 0s\n[DEBUG] 13:06:43.447 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:06:43.447 shell.go:GOOS() - 0s\n[DEBUG] 13:06:43.447 properties.go:GetString:28 \u2192 15:04\n[TRACE] 13:06:43.447 shell.go:TemplateCache() - 0s\n[TRACE] 13:06:43.448 shell.go:TemplateCache() - 0s\n[TRACE] 13:06:43.448 shell.go:Shell() - 0s\n[DEBUG] 13:06:43.448 shell.go:Getenv:397 \u2192 C:\\Users\\login\\AppData\\Local\n[TRACE] 13:06:43.448 shell.go:Getenv(LOCALAPPDATA) - 0s\n[TRACE] 13:06:43.448 shell_windows.go:CachePath() - 0s\n[TRACE] 13:06:43.448 shell.go:Flags() - 0s\n
\n

\u7f51\u7edc\u65ad\u5f00\u65f6\uff1a

\n
Cache path: C:\\Users\\login\\AppData\\Local\\oh-my-posh\n\nConfig path: C:\\Users\\login\\AppData\\Local\\Programs\\oh-my-posh\\themes\\cert.omp.json\n\nLogs:\n\n[DEBUG] 13:08:36.385 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:08:36.385 shell.go:Getenv(TERM_PROGRAM) - 0s\n[DEBUG] 13:08:36.385 shell.go:Getenv:397 \u2192 C:\\Users\\login\\AppData\\Local\n[TRACE] 13:08:36.385 shell.go:Getenv(LOCALAPPDATA) - 0s\n[TRACE] 13:08:36.385 shell_windows.go:CachePath() - 0s\n[DEBUG] 13:08:36.385 shell.go:Getenv:397 \u2192 C:\\Users\\login\\AppData\\Local\\Programs\\oh-my-posh\\themes\\cert.omp.json\n[TRACE] 13:08:36.385 shell.go:Getenv(POSH_THEME) - 0s\n[DEBUG] 13:08:36.412 shell.go:Shell:644 \u2192 process name: pwsh.exe\n[TRACE] 13:08:36.412 shell.go:Shell() - 26.4397ms\n[TRACE] 13:08:36.412 shell.go:resolveConfigPath() - 26.4397ms\n[TRACE] 13:08:36.412 shell.go:Init() - 26.9528ms\n[TRACE] 13:08:36.412 shell.go:Flags() - 0s\n[TRACE] 13:08:36.412 config.go:loadConfig() - 528.2\u00b5s\n[TRACE] 13:08:36.412 shell.go:Flags() - 0s\n[DEBUG] 13:08:36.412 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:08:36.412 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s\n[TRACE] 13:08:36.412 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\DWM\\ColorizationColor) - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.412 shell_windows.go:WindowsRegistryKeyValue:206 \u2192 ColorizationColor(DWORD): 0xC40078D4\n[TRACE] 13:08:36.412 shell.go:Shell() - 0s\n[DEBUG] 13:08:36.412 shell.go:Getenv:397 \u2192 7.3.6\n[TRACE] 13:08:36.412 shell.go:Getenv(POSH_SHELL_VERSION) - 0s\n[DEBUG] 13:08:36.412 debug.go:PrintDebug:23 \u2192 Segment: Title\n[TRACE] 13:08:36.412 shell.go:Flags() - 0s\n[DEBUG] 13:08:36.412 block.go:Debug:280 \u2192 Segment: session\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.412 shell.go:Pwd:427 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.412 shell.go:Pwd() - 0s\n[DEBUG] 13:08:36.412 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.412 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.412 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:08:36.412 shell.go:Getenv(SSH_CONNECTION) - 0s\n[DEBUG] 13:08:36.412 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:08:36.412 shell.go:Getenv(SSH_CLIENT) - 0s\n[TRACE] 13:08:36.413 shell_windows.go:Root() - 526.5\u00b5s\n[TRACE] 13:08:36.413 shell.go:Shell() - 0s\n[TRACE] 13:08:36.413 shell.go:ErrorCode() - 0s\n[TRACE] 13:08:36.413 shell_windows.go:IsWsl() - 0s\n[TRACE] 13:08:36.413 shell.go:Pwd() - 0s\n[DEBUG] 13:08:36.413 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.413 shell.go:User:548 \u2192 login\n[TRACE] 13:08:36.413 shell.go:User() - 0s\n[DEBUG] 13:08:36.413 shell.go:Host:560 \u2192 Avalon\n[TRACE] 13:08:36.413 shell.go:Host() - 0s\n[TRACE] 13:08:36.413 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.413 shell.go:Getenv:397 \u2192 NO DATA\n[TRACE] 13:08:36.413 shell.go:Getenv(SHLVL) - 0s\n[TRACE] 13:08:36.413 shell.go:TemplateCache() - 1.1125ms\n[TRACE] 13:08:36.413 shell.go:TemplateCache() - 0s\n[TRACE] 13:08:36.413 shell.go:Shell() - 0s\n[DEBUG] 13:08:36.414 block.go:Debug:280 \u2192 Segment: path\n[TRACE] 13:08:36.414 shell.go:Pwd() - 0s\n[DEBUG] 13:08:36.414 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:Pwd() - 0s\n[TRACE] 13:08:36.414 shell.go:Shell() - 0s\n[TRACE] 13:08:36.414 shell.go:Flags() - 0s\n[DEBUG] 13:08:36.414 properties.go:GetBool:22 \u2192 mapped_locations_enabled: true\n[DEBUG] 13:08:36.414 properties.go:GetString:28 \u2192 \uf013\n[DEBUG] 13:08:36.414 properties.go:GetString:28 \u2192 \uf013\n[DEBUG] 13:08:36.414 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.414 properties.go:GetString:28 \u2192 ~\n[DEBUG] 13:08:36.414 properties.go:GetKeyValueMap:46 \u2192 mapped_locations: map[]\n[TRACE] 13:08:36.414 shell.go:PathSeparator() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:PathSeparator() - 0s\n[TRACE] 13:08:36.414 shell.go:PathSeparator() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:PathSeparator() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:PathSeparator() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.414 shell.go:PathSeparator() - 0s\n[TRACE] 13:08:36.414 shell.go:Pwd() - 0s\n[TRACE] 13:08:36.414 shell_windows.go:IsWsl() - 0s\n[TRACE] 13:08:36.414 shell.go:StackCount() - 0s\n[DEBUG] 13:08:36.415 win32_windows.go:isWriteable:299 \u2192 not current user or in group\n[DEBUG] 13:08:36.415 win32_windows.go:isWriteable:303 \u2192 current user is member of S-1-5-32-544\n[DEBUG] 13:08:36.415 win32_windows.go:isWriteable:311 \u2193\n WRITE_DAC\n WRITE_OWNER\n SYNCHRONIZE\n DELETE\n READ_CONTROL\n[DEBUG] 13:08:36.415 win32_windows.go:isWriteable:313 \u2192 user has write access\n[TRACE] 13:08:36.415 shell_windows.go:DirIsWritable() - 518.6\u00b5s\n[TRACE] 13:08:36.415 shell.go:TemplateCache() - 0s\n[TRACE] 13:08:36.415 shell.go:TemplateCache() - 0s\n[TRACE] 13:08:36.415 shell.go:Shell() - 0s\n[DEBUG] 13:08:36.415 block.go:Debug:280 \u2192 Segment: git\n[TRACE] 13:08:36.415 shell.go:Pwd() - 0s\n[DEBUG] 13:08:36.415 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.415 shell.go:GOOS() - 0s\n[TRACE] 13:08:36.415 shell.go:GOOS() - 0s\n[ERROR] 13:08:36.419 shell.go:CommandPath:602 \u2192 exec: \"git.exe\": executable file not found in %PATH%\n[TRACE] 13:08:36.419 shell.go:CommandPath(git.exe) - 4.1797ms\n[TRACE] 13:08:36.419 shell.go:HasCommand(git.exe) - 4.1797ms\n[DEBUG] 13:08:36.419 block.go:Debug:280 \u2192 Segment: time\n[TRACE] 13:08:36.419 shell.go:Pwd() - 0s\n[DEBUG] 13:08:36.419 shell_windows.go:56 \u2192 C:\\Users\\login\n[TRACE] 13:08:36.419 shell.go:GOOS() - 0s\n[DEBUG] 13:08:36.419 properties.go:GetString:28 \u2192 15:04\n[TRACE] 13:08:36.419 shell.go:TemplateCache() - 0s\n[TRACE] 13:08:36.419 shell.go:TemplateCache() - 0s\n[TRACE] 13:08:36.419 shell.go:Shell() - 0s\n[DEBUG] 13:08:36.419 shell.go:Getenv:397 \u2192 C:\\Users\\login\\AppData\\Local\n[TRACE] 13:08:36.419 shell.go:Getenv(LOCALAPPDATA) - 0s\n[TRACE] 13:08:36.419 shell_windows.go:CachePath() - 0s\n[TRACE] 13:08:36.419 shell.go:Flags() - 0s\n
\n", "date_published": "2023-07-15T05:12:55+00:00", "title": "oh-my-posh \u5bfc\u81f4 powershell \u542f\u52a8\u7f13\u6162", "id": "t/956975" }, { "author": { "url": "member/xinghen57", "name": "xinghen57", "avatar": "https://cdn.v2ex.com/gravatar/49898a022667beb29951a580b31eeb9c?s=73&d=retro" }, "url": "t/930394", "title": "powershell \u7ba1\u9053\u95ee\u9898", "id": "t/930394", "date_published": "2023-04-06T14:14:00+00:00", "content_html": "

\u770b Powershell Rename-Item \u6587\u6863\u65f6\uff0c\u6709\u6279\u91cf\u547d\u540d\u6587\u4ef6\u7684 example \uff0c\u4ee3\u7801\u5982\u4e0b\uff1a

\n
Get-ChildItem *.txt | Rename-Item -NewName { $_.Name -replace '.txt','.log' }\n
\n

\u65e0\u6cd5\u7406\u89e3 Get-ChildItem \u83b7\u53d6\u7684\u6587\u4ef6\u540e\uff0c\u901a\u8fc7\u7ba1\u9053\uff0c\u5177\u4f53\u662f\u4f7f\u7528\u54ea\u79cd\u65b9\u5f0f\u4f20\u9012\u7ed9 Rename-Item \uff0c\u4ee5\u53ca\u4f20\u9012\u4e86\u4ec0\u4e48\u5185\u5bb9\u3002

\n

\u4e0a\u9762\u4ee3\u7801\u6211\u7684\u7406\u89e3\uff0cGet-ChildItem \u547d\u4ee4\u7684\u7ed3\u679c\u901a\u8fc7\u7ba1\u9053\u4f20\u9012\u7ed9\u4e86 Rename-Item \u7684 Path \u53c2\u6570\u3002\u4f46 Path \u53ea\u63a5\u53d7 string \u3002\u5982\u679c\u7ba1\u9053\u662f ByValue \u65b9\u5f0f\uff0c\u4f20\u9012\u7684\u5e94\u8be5\u662f Object \uff0c\u6240\u4ee5\u4e0d\u662f ByValue \u3002\u5982\u679c\u662f ByPropertyName \uff0cGet-ChildItem \u83b7\u53d6\u7684 FileInfo \u5bf9\u8c61\u5e76\u6ca1\u6709 Path \u5c5e\u6027\uff0c\u7406\u8bba\u4e0a\u4e5f\u65e0\u6cd5\u4f20\u9012\u3002

\n" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/917240", "title": "\u5982\u4f55\u5728\u6253\u5f00 powershell \u811a\u672c\u7684\u65f6\u5019\uff0c cd \u5230\u811a\u672c\u6240\u5728\u76ee\u5f55", "id": "t/917240", "date_published": "2023-02-18T14:09:48+00:00", "content_html": "\u5047\u5982\u811a\u672c\u540d\u4e3a 888.ps1
\u811a\u672c\u4f4d\u4e8e:C:\\Users\\yerin\\Desktop\\888.ps1
\u6211\u60f3\u8981\u6253\u5f00\u8fd9\u4e2a\u811a\u672c\u7684\u65f6\u5019\uff0c\u8fd0\u884c\u76ee\u5f55\u53ef\u4ee5\u81ea\u52a8 CD \u5230\uff1aC:\\Users\\yerin\\Desktop

\u6ce8\uff1a\u6211\u660e\u767d pow \u811a\u672c\uff0c\u9ed8\u8ba4\u662f\u4ee5\u811a\u672c\u6240\u5728\u76ee\u5f55\u8fd0\u884c\u7684\uff0c\u4f46\u662f\u6211\u7528\u952e\u76d8\u7684\u5b8f\u5b9a\u4e49\u6253\u5f00 pow \u811a\u672c\u7684\u65f6\u5019\uff0c\u5e76\u4e0d\u4f1a\u6309\u7167\u4e4b\u524d\u7684\u72b6\u6001\u8fdb\u884c\uff0c\u6253\u5f00\u7684\u65f6\u5019\u5374\u662f\u5b8f\u8f6f\u4ef6\u7684\u76ee\u5f55\uff0c

\u6211\u641c\u7d22\u5230\u6709\u4e00\u4e2a\u547d\u4ee4\u6709\u4f5c\u7528
```
cd (Split-Path -Parent $MyInvocation.MyCommand.Definition)
```
\u8fd9\u6837\u786e\u5b9e\u4f1a\u8df3\u8f6c\u5230\u811a\u672c\u6240\u5728\u76ee\u5f55\uff0c\u4f46\u662f\u9047\u5230\u6709\u7a7a\u683c\u7684\u6240\u5728\u76ee\u5f55\u5c31\u4f1a\u62a5\u9519\uff0c\u5982\u4f55\u624d\u80fd\u52a0\u4e0a\u53cc\u5f15\u53f7\u62ec\u4f4f


\u4ee5\u4e0b\u6709\u4e00\u4e2a CMD \u6211\u7ecf\u5e38\u7528\u7684\u547d\u4ee4\uff0c\u800c\u4e14\u78b0\u5230\u7a7a\u683c\u952e\u4e5f\u53ef\u4ee5 CD \u8fdb\u53bb
```
cd %~dp0
%~d0
```
\u8fd9\u6837\u7684\u8bdd CMD \u5c31\u4f1a\u81ea\u5df1 CD \u5230 bat \u7684\u6240\u5728\u76ee\u5f55\uff0c\u6211\u4e0d\u77e5\u9053 powershell \u6709\u6ca1\u6709\u7c7b\u4f3c\u7684\u64cd\u4f5c" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/917100", "title": "\u5982\u4f55\u8ba9 powershell \u8f93\u51fa\u7684 txt \u65e5\u5fd7\u4e3a unix lf \u683c\u5f0f", "id": "t/917100", "date_published": "2023-02-17T21:24:17+00:00", "content_html": "\u4ee5\u4e0b\u547d\u4ee4\u4f1a\u5bfc\u51fa\u4e00\u4e2a Windows CRLF \u683c\u5f0f\u7684 txt \uff0c\u4f46\u662f\u6211\u60f3\u8981\u4ed6\u8f93\u51fa unix lf \uff0c\u5982\u4f55\u624d\u80fd\u6539\u53d8\uff1f


```
*>&1 | ForEach-Object {if($_ -notin (Get-Content 888.txt)){Add-Content 888.txt $_ -Encoding utf8; $_}}

```
" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/916822", "title": "\u8fd9\u4e2a powershell \"\u6bd4\u5bf9\u201d\u547d\u4ee4\u80fd\u4f18\u5316\u5417\uff1f", "id": "t/916822", "date_published": "2023-02-17T00:28:11+00:00", "content_html": "\u521a\u5f00\u59cb\u8fd0\u884c\u6548\u7387\u8fd8\u633a\u5feb\uff0c\u4f46\u662f\u5f53\u6587\u672c\u91cf\u8d77\u6765\u540e\u5c31\u6162\u4e86\uff0c\u6240\u4ee5\u5982\u4f55\u63d0\u9ad8\u4e0b\u9762\u547d\u4ee4\u7684\u6548\u7387
```
*>&1 | ForEach-Object {if($_ -notin (Get-Content 888.txt)){Add-Content 888.txt $_ -Encoding utf8; $_}}

```

\u89c4\u5219\u662f\u201c\u6574\u884c\u201d\u5185\u5bb9\u5339\u914d\uff0c\u800c\u4e0d\u662f\u201c\u5305\u542b\u201d\u5185\u5bb9\u5339\u914d

\u89e3\u91ca\u4e00\u4e0b\uff0c\u4e0a\u9762\u662f\u5c06 888.txt \u91cc\u7684\u5185\u5bb9\u8ddf powershell \u63a7\u5236\u53f0\u7684\u8f93\u51fa\u8fdb\u884c\u6bd4\u5bf9\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u63a7\u5236\u53f0\u8f93\u51fa\u4e86\u201chello world\u201d\u7684\u8bdd\uff0c\u5c31\u4f1a\u6bd4\u5bf9 888.txt \u6709\u6ca1\u6709\u76f8\u540c\u7684\u5185\u5bb9\uff0c\u5982\u679c 888.txt \u91cc\u4e5f\u6709\u4e00\u6574\u884c\u5199\u7740\u201chello world\u201d\u5219\u4e0d\u8ffd\u52a0\u5199\u5165 txt" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/915817", "title": "powershell \u8fd0\u884c ps \u6587\u4ef6\u7684\u65f6\u5019\uff0c\u5982\u4f55\u652f\u6301\u5e26\u7a7a\u683c\u7684\u8def\u5f84", "id": "t/915817", "date_published": "2023-02-13T13:07:45+00:00", "content_html": "\u5217\u5982\u6211\u5728\u4ee5\u4e0b\u7684\u6587\u4ef6\u5939\u4e2d\u6253\u5f00\u4e86\u4e00\u4e2a PS \u6587\u4ef6

C:\\Users\\yerin\\Desktop\\\u65b0\u5efa\u6587\u4ef6\u5939 (2)\\\u65e0\u6807\u9898 8.ps1

\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u4e0a\u9762\u7684\u8def\u5f84\u4e2d\u6709\u7a7a\u683c\uff0c\u7531\u4e8e ps \u6587\u4ef6\u9ed8\u8ba4\u662f\u4ee5\u5f53\u524d\u8fd0\u884c\u7684\u76ee\u5f55\u4f5c\u4e3a\u8fd0\u884c\u8def\u5f84\uff0c\u800c\u4e0a\u9762\u8def\u5f84\u4e5f\u6ca1\u6709\u53cc\u5f15\u53f7\u5708\u8d77\u6765\uff0c\u4e5f\u6ca1\u6cd5\u5708\u8def\u5f84\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\u5f53\u524d\u8def\u5f84\u5e26\u6709\u7a7a\u683c\u7684\u95ee\u9898\uff1f\u867d\u7136\u63a7\u5236\u53f0\u53ef\u4ee5\u53cc\u5f15\u53f7\u8def\u5f84\uff0c\u4f46\u662f ps \u6587\u4ef6\u6ca1\u6cd5\u4e8b\u5148\u53cc\u5f15\u53f7\u8def\u5f84


\u8fd8\u6709\u53e6\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u6211\u53f3\u952e ps \u6587\u4ef6\u7684\u65f6\u5019\uff0c\u6709\u4e2a\u9009\u9879\u662f\u201c\u4f7f\u7528 powershell \u8fd0\u884c\u201d\uff0c\u8fd9\u65f6\u5019\u5f53\u524d\u8def\u5f84\u5e26\u7a7a\u683c\u4e5f\u6ca1\u4e8b
\u4f46\u662f\u5982\u679c\u6211\u7ed1\u5b9a\u4e86\u9ed8\u8ba4\u5e94\u7528\uff0c\u4e5f\u5c31\u662f\u6240\u6709 ps1 \u6587\u4ef6\u90fd\u4ee5\u201cC:\\Windows\\System32\\WindowsPowerShell\\v1.0\u201d\u6539\u8def\u5f84\u4e0b\u7684 powershell \u8fd0\u884c\uff0c\u7136\u540e\u6b64\u65f6\u6211\u53cc\u51fb\u8fd0\u884c\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u51fa\u73b0\u6211\u4e0a\u8ff0\u7b2c\u4e00\u4e2a\u95ee\u9898\uff0c\u8be5\u8def\u5f84\u627e\u4e0d\u5230" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/914935", "title": "cmd \u8f93\u51fa\u65e5\u5fd7\u7684\u65f6\u5019\uff0c\u5982\u4f55\u4e0d\u5199\u5165\u91cd\u590d\u65e5\u5fd7", "id": "t/914935", "date_published": "2023-02-10T07:48:55+00:00", "content_html": "\u5f53\u7528 cmd \u8f93\u51fa\u65e5\u5fd7\u7684\u65f6\u5019\uff0c\u5217\u5982\u201c>> \"log11.txt\"\uff0c\u4ec5\u51ed cmd \u81ea\u8eab\u7684\u529f\u80fd\uff0c\u80fd\u4e0d\u80fd\u5224\u65ad\u5df2\u8f93\u51fa\u7684\u5185\u5bb9\uff0c\u548c\u63a7\u5236\u53f0\u7684\u5185\u5bb9\u4e0d\u91cd\u590d\uff0c\u5c31\u662f\u8bf4\uff0c\u5982\u679c txt \u91cc\u67d0\u884c\u5185\u5bb9\u662f\u201chello world\u201d\uff0c\u5982\u679c\u63a7\u5236\u53f0\u91cc\u53c8\u51fa\u73b0\u4e86\u201chello world\u201d\uff0c\u5219\u4e0d\u518d\u8ffd\u52a0\u5199\u5165\u5230 txt \u91cc\u3002

\u6ce8\u610f\uff01\u662f\u6574\u884c\u5185\u5bb9\u76f8\u5339\u914d\u5c31\u4e0d\u8ffd\u52a0\u5199\u5165\uff0c\u800c\u4e0d\u662f\u51fa\u73b0\u201chello world\u201d\u5c31\u6574\u884c\u4e0d\u4e0d\u5199\u5165" }, { "author": { "url": "member/SuzhaharCan", "name": "SuzhaharCan", "avatar": "https://cdn.v2ex.com/gravatar/8ce5663bf1f3e6f68f8997d462755180?s=73&d=retro" }, "url": "t/908061", "title": "\u8bf7\u6559-\u5173\u4e8e PowerShell \u7684\u4f7f\u7528\u573a\u666f\u95ee\u9898\u2014\u2014\u7ade\u8d5b\uff0c\u7f16\u7a0b\u6311\u6218\uff0c\u8fd0\u7ef4\u9700\u6c42\u5728\u54ea\u91cc\u627e", "id": "t/908061", "date_published": "2023-01-11T01:06:41+00:00", "content_html": "

\u8d34\u4e3b\uff0c23 \u5e74\u672c\u79d1\u6bd5\u4e1a\u751f\uff0c\u73b0\u5728\u676d\u5dde\u4f20\u7edf\u4e92\u8054\u7f51\u7684\u516c\u53f8\u5b9e\u4e60\uff0cC#/WinForm \u5f00\u53d1\uff0c\u5148\u5b66\uff0c\u4e4b\u540e\u7cbe\u8fdb \uff0c\u8003\u8651\u8f6c\u5176\u4ed6\u7684\u8def\u7ebf\uff1b\uff08\u4ecb\u7ecd\u53ea\u662f \u60f3\u8868\u660e \uff0c\u81ea\u5df1 \u521a\u8fdb\u5165\u884c\u4e1a\u6ca1\u591a\u4e45 \uff09\n\u4f46\u662f\uff0c\u81ea\u5df1\u81ea\u5b66 PowerShell \uff0c\u7ba1\u9053\u3001\u6587\u4ef6\u3001WMI \u7b49\u90e8\u5206\u90fd\u5b66\u4e60\u6d89\u730e\uff1b\n\u7406\u8bba\u90e8\u5206\u90fd\u5b66\u5b8c 2 \u904d\uff0c\u90fd\u80fd\u7406\u89e3\uff0c\u4f46\u662f\u6ca1\u6709\u4ee5\u6a21\u5757\u5316\u811a\u672c\u7f16\u5199\u8fc7

\n

\u6211\u4e2a\u4eba\u662f\u5728 Windows \u7aef\u4f7f\u7528\uff0c23 \u5e74 9 \u6708\u4f1a \u4f7f\u7528 Linux \u548c\u9ed1\u82f9\u679c\uff0c\u6240\u4ee5 \uff0c\u4e0d\u53d7\u7cfb\u7edf\u7684\u9650\u5236\n\u4e2a\u4eba\u76ee\u524d \u662f \u501f\u52a9 CodeWars \u8fd9\u4e2a\u5237\u9898\u7f51\u7ad9\u6765\u7ec3\u4e60 PowerShell \u811a\u672c\u7f16\u5199\uff1b\u611f\u89c9 \u548c\u7528 C#\u7f16\u5199\u65b9\u6cd5\u51fd\u6570\u5dee\u4e0d\u591a

\n

\u73b0\u5728\u5b66\u4e60\u6709\u4e9b\u5403\u529b\uff0c\u60f3\u901a\u8fc7 \u811a\u672c\u7ade\u8d5b\u3001\u7f16\u7a0b\u6311\u6218\u7f51\u7ad9\u3001\u5916\u5305\u8fd0\u7ef4\u9700\u6c42\u7b49 \u65b9\u5f0f\uff0c\u4e0a\u624b\u5b9e\u8df5\u7ec3\u4e60\u4e00\u756a \uff1b\n\u6240\u4ee5\uff0c\u6211\u60f3\u8bf7\u6559\u4e00\u4e0b \u901a\u8fc7\u4e1a\u52a1\u573a\u666f\u6216\u8005 \u9700\u6c42 \u6765\u9a71\u52a8 \u7ec3\u4e60 PowerShell \u7684\u65b9\u5f0f\u6709\u54ea\u4e9b\uff1f\n\u4e2a\u4eba\u77e5\u9053 Windows \u8fd0\u7ef4 \u591a\u5c11\u9700\u8981\u5b66\u4e00\u4e0b PowerShell \u7684\uff1b\n\u5982\u6709** \u8def\u8fc7\u7684\u8fd0\u7ef4\u5e08\uff0c\u53ef\u5426\u6307\u70b9\u4e00\u4e0b PowerShell \u7684\u5b66\u4e60\uff0c\u53ef\u4ee5\u7684\u8bdd\uff0c\u771f\u5fc3\u611f\u8c22**\npS:PowerShell \u4f20\u6559\u58eb\u7684\u7fa4\uff0c\u6211\u52a0\u5165\uff0c\u786e\u5b9e\u5438\u6536\u4e0d\u9519\u7684\u5185\u5bb9\uff1b

\n" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/886777", "title": "Windows \u8fd0\u884c ffmpeg \u6279\u91cf\u811a\u672c\u7684\u65f6\u5019\uff0c\u5982\u4f55\u5728\u4e0d\u4e2d\u65ad\u7684\u60c5\u51b5\u4e0b\u9650\u5236 CPU \u4f7f\u7528\u7387", "id": "t/886777", "date_published": "2022-10-13T15:44:56+00:00", "content_html": "\u56e0\u4e3a\u8f6c\u7801\u7684\u673a\u5668\u4e5f\u662f\u6211\u6b63\u5728\u4f7f\u7528\u7684\u673a\u5668\uff0c\u6240\u4ee5\u8fd0\u884c\u7684\u65f6\u5019\u662f\u4f1a\u5f71\u54cd\u5230\u6211\u65e5\u5e38\u4f7f\u7528\u7684\uff0c\u4f46\u662f ffmpeg \u4e5f\u6ca1\u6cd5\u505c\u4e0b\u6765\uff0c\u867d\u7136\u4e5f\u53ef\u4ee5\u7528\u7eed\u4f20\u65b9\u6cd5\u7ee7\u7eed\u4e0a\u6b21\u6ca1\u5b8c\u6210\u7684\u8fdb\u7a0b\uff0c\u5948\u4f55\u6211\u7684\u4ee3\u7801\u6e23\uff0c\u8fd9\u811a\u672c\u4e5f\u662f\u6211\u627e\u522b\u4eba\u5199\u7684\uff0c\u6240\u4ee5\u6211\u5c31\u60f3\u7740\uff0c\u80fd\u4e0d\u80fd\u5728\u6211\u7528\u7684\u65f6\u5019\u9650\u5236\u4e00\u4e0b ffmpeg \u7684\u5360\u7528\uff1f\u7136\u540e\u7b49\u6211\u8981\u7761\u89c9\u7684\u65f6\u5019\u5c31\u653e\u5f00\u7981\u7528\uff0c\u8fd9\u4e2d\u9014\u4e0d\u80fd\u4e2d\u65ad\uff0c\u867d\u7136 Windows \u4efb\u52a1\u7ba1\u7406\u5668\u53ef\u4ee5\u8bbe\u7f6e\u9650\u5236 CPU \u4f7f\u7528\u6838\u5fc3\u6570\uff0c\u4f46\u662f\u201c\u91cd\u70b9\u201d\u6765\u4e86\uff0c\u8fd9\u662f\u4e2a\u6279\u91cf\u811a\u672c\uff0c\u6bcf\u6b21\u8f6e\u5230\u4e0b\u4e00\u4e2a\u89c6\u9891\u7684\u65f6\u5019\uff0c\u4efb\u52a1\u7ba1\u7406\u5668\u5c31\u4f1a\u91cd\u7f6e\u521a\u624d\u7684\u6838\u5fc3\u6570\u9650\u5236\uff0c\u6240\u4ee5\u60f3\u95ee\u6709\u6ca1\u6709\u529e\u6cd5\u8ba9\u4ed6\u8bbe\u7f6e\u7684\u9650\u5236\u53ef\u4ee5\u4e00\u76f4\u4fdd\u6301\u7740\u5c31\u7b97\u65b0\u8fdb\u7a0b\u5efa\u7acb\uff0c\u4e5f\u4f1a\u7ef4\u6301\u4e4b\u524d\u5bf9\u8fd9\u4e2a\u201c\u7a0b\u5e8f\u201d\u7684\u9650\u5236" }, { "author": { "url": "member/1054850490", "name": "1054850490", "avatar": "https://cdn.v2ex.com/avatar/0568/22f0/554537_large.png?m=1670165418" }, "url": "t/884551", "title": "cmd \u63a7\u5236\u53f0\u663e\u793a\u8f93\u51fa\u65e5\u5fd7\u8fc7\u6ee4", "id": "t/884551", "date_published": "2022-10-03T16:17:17+00:00", "content_html": "\u5982\u6700\u4e0b\u65b9\u6240\u793a\uff0ccmd \u6253\u5370\u592a\u591a\u7684\u4e0b\u8f7d\u901f\u5ea6\uff0c\u5982\u4f55\u8ba9\u5b83\u51cf\u5c11\uff0c\u6216\u8005\u4e0d\u6253\u5370\u8be5\u8f93\u51fa





\u6240\u7528\u4ee3\u7801\">> log.txt 2>&1\"

\u4f8b\uff1a
[youtube] OT5CfLnS3i4: Downloading webpage
[youtube] OT5CfLnS3i4: Downloading android player API JSON
[info] OT5CfLnS3i4: Downloading 1 format(s): 313+251
[download] Destination: [8K] 220930 (VIVIZ)(EUNHA)-BOP BOP!FANCAM by DahinMaru [OT5CfLnS3i4].f313.webm

[download] 0.0% of 347.69MiB at 20.51KiB/s ETA 04:49:21
[download] 0.0% of 347.69MiB at 60.87KiB/s ETA 01:37:28
[download] 0.0% of 347.69MiB at 142.04KiB/s ETA 41:46
[download] 0.0% of 347.69MiB at 304.37KiB/s ETA 19:29
[download] 0.0% of 347.69MiB at 153.67KiB/s ETA 38:36
[download] 0.0% of 347.69MiB at 200.95KiB/s ETA 29:31
[download] 0.0% of 347.69MiB at 262.78KiB/s ETA 22:34
[download] 0.1% of 347.69MiB at 420.53KiB/s ETA 14:06
[download] 0.1% of 347.69MiB at 657.11KiB/s ETA 09:01
[download] 0.3% of 347.69MiB at 971.20KiB/s ETA 06:05
[download] 0.6% of 347.69MiB at 1.60MiB/s ETA 03:36
[download] 1.2% of 347.69MiB at 2.82MiB/s ETA 02:01
[download] 2.3% of 347.69MiB at 4.85MiB/s ETA 01:10
[download] 2.8% of 347.69MiB at 5.51MiB/s ETA 01:01
[download] 2.8% of 347.69MiB at 6.04KiB/s ETA 15:54:40
[download] 2.8% of 347.69MiB at 18.07KiB/s ETA 05:19:14
[download] 2.8% of 347.69MiB at 42.17KiB/s ETA 02:16:49
[download] 2.8% of 347.69MiB at 90.36KiB/s ETA 01:03:50
[download] 2.8% of 347.69MiB at 142.10KiB/s ETA 40:35" }, { "author": { "url": "member/chackchackGO", "name": "chackchackGO", "avatar": "https://cdn.v2ex.com/avatar/1bfa/a60b/455835_large.png?m=1665830450" }, "url": "t/879763", "date_modified": "2022-09-13T09:00:40+00:00", "content_html": "

powershell7 \u7b2c\u4e00\u6761\u6307\u4ee4\u7684\u5ef6\u8fdf\u5927\u6982 3s+, \u540e\u7eed\u4f7f\u7528 ls \u6307\u4ee4\u4e5f\u6709 2s \u5de6\u53f3\u5ef6\u8fdf, \u81ea\u52a8\u8865\u5168\u901f\u5ea6\u4e5f\u5f88\u6162.

\n

\u6211\u6ca1\u6709 google \u5230\u7c7b\u4f3c\u7684\u95ee\u9898, \u8bf7\u95ee\u6709\u7c7b\u4f3c\u60c5\u51b5\u7684\u670b\u53cb\u5417?
\n\u6211\u7684\u73af\u5883\u662f\u539f\u7248 windows10, \u4fdd\u6301\u7740\u66f4\u65b0. version 21h2(build 19044.1889)

\n", "date_published": "2022-09-13T09:00:09+00:00", "title": "powershell7, \u6267\u884c\u901f\u5ea6\u548c\u81ea\u52a8\u8865\u5168\u901f\u5ea6\u90fd\u6162\u7684\u4ee4\u6211\u6293\u72c2", "id": "t/879763" }, { "author": { "url": "member/Moris", "name": "Moris", "avatar": "https://cdn.v2ex.com/gravatar/ca808aba66c83e79f193d4a7ae6d7060?s=73&d=retro" }, "url": "t/875276", "title": "\u8bf7\u6559\u4e00\u4e0b.ps1 \u8fd0\u884c\u65f6\u5982\u4f55\u8ba9 powerShell \u540c\u65f6\u663e\u793a\u6240\u8fd0\u884c\u547d\u4ee4\u7684\u5185\u5bb9", "id": "t/875276", "date_published": "2022-08-25T03:24:54+00:00", "content_html": "

\u6211\u5199\u4e86\u4e2a test.ps1 \uff0c\u5185\u5bb9\u662f

\n
echo TEST\n
\n

\u8fd0\u884c\u7ed3\u679c\u53ea\u6709\u4e00\u4e2a TEST

\n

\u8bf7\u95ee\u5982\u4f55\u8ba9 echo TEST \u540c\u65f6\u663e\u793a\u51fa\u6765\uff1f

\n" }, { "author": { "url": "member/7zlid", "name": "7zlid", "avatar": "https://cdn.v2ex.com/gravatar/5aa5a8fae869633e358e892f79d46b4b?s=73&d=retro" }, "url": "t/866249", "title": "\u6709\u4ec0\u4e48\u4e0d\u9519\u7684 powershell \u4e66\u7c4d\u5417\uff1f", "id": "t/866249", "date_published": "2022-07-14T14:13:44+00:00", "content_html": "" }, { "author": { "url": "member/Kaiv2", "name": "Kaiv2", "avatar": "https://cdn.v2ex.com/avatar/7657/2b81/351804_large.png?m=1725370294" }, "url": "t/855365", "title": "PowerShell \u662f\u5426\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c expect \u7684\u529f\u80fd\uff1f", "id": "t/855365", "date_published": "2022-05-26T02:06:14+00:00", "content_html": "

\u5982\u9898\uff0c\u6700\u8fd1\u5207\u6362\u5230\u4e86 Windows \u4e86\uff0c\u767b\u5f55\u670d\u52a1\u5668\uff08\u6709\u8df3\u677f\u673a\uff09\u592a\u9ebb\u70e6 \uff0c\u60f3\u914d\u7f6e\u81ea\u52a8\u5316\u811a\u672c\uff08\u53d1\u5e03\uff0c\u67e5\u8be2\u65e5\u5fd7\uff09\u3002PowerShell \u4e2d\u662f\u5426\u6709\u7c7b\u578b expect \u7684\u8f6f\u4ef6

\n" }, { "author": { "url": "member/CUPAIR", "name": "CUPAIR", "avatar": "https://cdn.v2ex.com/avatar/f8b5/0732/466784_large.png?m=1665719609" }, "url": "t/845128", "title": "PowerShell \u542f\u52a8\u6162", "id": "t/845128", "date_published": "2022-04-06T01:15:36+00:00", "content_html": "

pwsh\uff1apowershell7.15; powershell: powershellv1.0,\u4e0d\u77e5\u9053\u5565\u7248\u672c\uff0c\u5c31 win11 \u81ea\u5e26\u7684 :

\n\n

\u8fd9\u4e2a\u5ef6\u8fdf\u592a\u9ad8\u4e86\uff0c\u4e0d\u77e5\u9053\u6709\u4ec0\u4e48\u4f18\u5316\u65b9\u6cd5\u6ca1\uff0cstackoverflow\u4e0a\u63d0\u5230.net \u6846\u67b6\u5347\u7ea7\uff0c\u611f\u89c9\u4e0d\u600e\u4e48\u9760\u8c31\uff0c\u56e0\u4e3apowershell -noprofile\u8fd9\u4e2a\u6307\u4ee4\u57fa\u672c\u6ca1\u5565\u5ef6\u8fdf\uff0c\u6240\u4ee5\u611f\u89c9\u5e94\u8be5\u662f\u914d\u7f6e\u6587\u4ef6\u4f18\u5316\u7684\u95ee\u9898\uff0c\u6709 v \u53cb\u61c2\u5982\u4f55\u4f18\u5316\u5417

\n" }, { "author": { "url": "member/fengsien1999", "name": "fengsien1999", "avatar": "https://cdn.v2ex.com/gravatar/30c5f9bff4b1fa1a4e3325e1cc75a9be?s=73&d=retro" }, "url": "t/838173", "date_modified": "2022-03-05T06:44:50+00:00", "content_html": "

\u662f\u4e0d\u662f\u638c\u63e1 Linux \u7684 Shell \u5c31\u53ef\u4ee5\u4e86\uff1f

\n", "date_published": "2022-03-05T05:53:33+00:00", "title": "\u73b0\u5728 PowerShell \u662f\u4e0d\u662f\u6ca1\u6709\u4ec0\u4e48\u7528\uff1f", "id": "t/838173" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/828462", "title": "PowerShell \u7adf\u7136\u5f3a\u608d\u5982\u65af\uff01", "id": "t/828462", "date_published": "2022-01-15T10:35:09+00:00", "content_html": "

\u6709\u5927\u4f6c\u7528 PowerShell \u5199\u4e86\u4e2a Windows \u7684\u8fdc\u7a0b\u684c\u9762\u5de5\u5177\uff0c\u636e\u4f5c\u8005\u8bf4\uff0c\u5e76\u6ca1\u6709\u4f9d\u8d56\u4e8e\u4efb\u4f55\u73b0\u6709\u7684\u8fdc\u7a0b\u684c\u9762\u5e94\u7528\u6216\u534f\u8bae\uff0c\u8fd9\u4e2a\u9879\u76ee\u6f14\u793a\u4e86\u4e3a\u4ec0\u4e48 PowerShell \u6562\u7528 Power \u8fd9\u4e2a\u8bcd\uff01
\n\"\"

\n

Github: https://github.com/DarkCoderSc/PowerRemoteDesktop

\n" }, { "author": { "url": "member/youcall911", "name": "youcall911", "avatar": "https://cdn.v2ex.com/avatar/32de/7ba5/302759_large.png?m=1599032501" }, "url": "t/790254", "title": "\u8bf7\u95ee\u5982\u4f55\u4f7f\u7528 powershell \u7981\u7528/\u542f\u7528\u8bbe\u5907\uff1f", "id": "t/790254", "date_published": "2021-07-18T13:49:41+00:00", "content_html": "

\u89e6\u6478\u677f\u6709\u65f6\u4f1a\u5931\u7075\uff0c\u6211\u60f3\u7528\u811a\u672c\u7684\u65b9\u5f0f\u91cd\u542f\u8bbe\u5907\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5417\uff1f

\n

\u5e0c\u671b\u80fd\u6709\u6bd4\u8f83\u8be6\u7ec6\u7684\u6559\u5b66\uff0c\u8c22\u8c22\u3002

\n" }, { "author": { "url": "member/zoomla", "name": "zoomla", "avatar": "https://cdn.v2ex.com/gravatar/d42a307a48b30b3f9fd231aeca84c900?s=73&d=retro" }, "url": "t/717685", "title": "\u9010\u6d6a CMSv8.2 \u53d1\u5e03-\u96c6\u6210 Node \u4e0e Vue \u811a\u624b\u67b6\u548c PowerShell \u652f\u6301\u7684\u65b0\u4e00\u4ee3\u7f51\u7ad9\u7ba1\u7406\u7cfb\u7edf", "id": "t/717685", "date_published": "2020-10-23T01:14:05+00:00", "content_html": "
\n

\u697c\u501a\u971c\u6811\u5916\uff0c\u955c\u5929\u65e0\u4e00\u6beb\u3002\n\u5357\u5c71\u4e0e\u79cb\u8272\uff0c\u6c14\u52bf\u4e24\u76f8\u9ad8\u3002\n-\uff08\u5510\uff09\u675c\u7267

\n
\n

\u5317\u4eac\u65f6\u95f4 2020 \u5e74 10 \u6708 20 \u65e5\uff1a\u9886\u5148\u7684 CMS \u4e0e web \u5185\u6838\u670d\u52a1\u5546\u3001\u4e2d\u56fd\u552f\u4e00\u5177\u5907 CMS \u4e0e\u5b57\u5e93\u56fe\u5e93\u5168 web \u5448\u73b0\u81ea\u4e3b\u77e5\u8bc6\u4ea7\u6743\u3001alexa \u6392\u540d\u7b2c\u4e00\u7684\u4e2d\u6587 CMS \u5382\u5546--\u4e0a\u6d77 Zoomla!\u9010\u6d6a\u8f6f\u4ef6\u56e2\u961f\u5ba3\u5e03\uff0c\u53d1\u5e03\u6700\u65b0\u4e00\u4ee3 CMS \u4ea7\u54c1\uff1aZoomla!\u9010\u6d6a CMS v8.2.0 \u3002

\n

\u8fd9\u662f\u7ee7\u9010\u6d6a CMS V8.1.x \u4e4b\u540e\u7684\u5168\u65b0\u4e00\u4ee3\u4ea7\u54c1\uff0c\u6211\u4eec\u4e3a\u6b64\u542f\u7528\u4e86\u5168\u65b0\u7684\u7248\u672c\u53f7\uff0c \u5373\uff1av8.2.x \u7cfb\u5217\u3002

\n

\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"

\n

\u4e00\u952e\u96c6\u6210 Github \u4e0e Npm \u53d1\u5e03\u529f\u80fd\uff0c\u4e0e node \u5f00\u53d1\u5e73\u53f0\u65e0\u7f1d\u96c6\u5408\uff0c\u4ece\u800c\u652f\u6301\u66f4\u52a0\u5f3a\u5927\u7684\u667a\u80fd\u5f00\u53d1\u3002

\n\n

\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"

\n

\u96c6\u6210 PowerShell \u7ba1\u7406\u529f\u80fd\uff0c\u8fd9\u662f\u4e0e python \u540c\u7ea7\u522b\u7684\u667a\u80fd\u8bed\u8a00\u4f53\u7cfb\uff0c\u9a71\u52a8\u672a\u6765\uff0c\u9a71\u52a8\u667a\u80fd AI \u65b0\u65f6\u4ee3\u3002

\n\n

\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"

\n

\u662f\u7684\uff0c\u73b0\u5728\u4f60\u4e0d\u9700\u8981\u4e3a\u914d\u7f6e\u590d\u6742\u7684 IIS\uff0c\u4efb\u4f55 64 \u4f4d\u7cfb\u7edf\uff08\u5546\u4e1a\u7248\u652f\u6301\u5176\u5b83\u4f4d\u6570\uff09\uff0c\u53ea\u8981\u70b9\u51fb\u6839\u76ee\u5f55\u7684 ZoomLaCMS.exe \u5c31\u80fd\u5feb\u901f\u542f\u52a8\uff0c\u540c\u65f6\u96c6\u6210\u81ea\u52a8\u96c6\u6210 CI/CD\uff0c\u5f3a\u5927\u5353\u8d8a\uff0c\u6548\u7387\u6781\u901f

\n\n
Areas/User/Views/Content/MyMDPic.cshtml\nAreas/User/Views/Content/AddMDPic.cshtml\n
\n

\u524d\u53f0\u8bbf\u95ee\u8def\u5f84\uff1a/User/Content/MyMDPic?NodeID=\u7ed1\u5b9a\u56fe\u5e93\u6a21\u578b\u8282\u70b9 ID

\n\n

\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"

\n

\u96c6\u6210 OCR \u8bc6\u522b\u4e0e\u6587\u5b57\u51fa\u7248\uff0c\u662f\u56fd\u5185\u552f\u4e00\u5177\u5907\u5b57\u4f53\u8bbe\u8ba1\u4e2d\u53f0\u5185\u6838\u7684\u5f3a\u5927 CMS

\n

\u6211\u4eec\u540c\u65f6\u5c06\u8fd9\u4e00\u529f\u80fd\u53d1\u5e03\u5728 http://v.ziti163.com \u5e73\u53f0\uff0c\u4f7f\u6bcf\u4e2a\u5f00\u53d1\u8005\u90fd\u80fd\u4f53\u9a8c\u5230\u56fd\u5185\u9996\u4e2a\u5f00\u653e\u5b57\u4f53\u751f\u4ea7\u6280\u672f\u7684\u8f6f\u4ef6\u56e2\u961f-\u9010\u6d6a\u8f6f\u4ef6\u56e2\u4eba\u7684\u667a\u6167\u7ed3\u6676\u3002

\n\n" }, { "author": { "url": "member/ColinZeb", "name": "ColinZeb", "avatar": "https://cdn.v2ex.com/avatar/eb39/2b32/200718_large.png?m=1720500625" }, "url": "t/694017", "date_modified": "2020-07-29T05:45:05+00:00", "content_html": "

\u5728 windows \u4e0a\u8bd5\u7528 gzip \u9047\u5230\u4e2a\u7ba1\u9053\u7684\u5751\u3002

\n

windows \u4e0a\u662f\u6ca1\u6709 gzip \u547d\u4ee4\u7684\u3002

\n

\u9996\u5148\u5b89\u88c5 scoop install gzip

\n

\u538b\u7f29\u547d\u4ee4\u4e00\u822c\u8fd9\u4e48\u5199 cat script.ps1|gzip >script.gz

\n

\u8fd9\u4e2a\u5199\u6cd5\u5728 bash zsh \u548c cmd \u90fd\u80fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f46\u662f pwsh \u4e0d\u884c\uff0c\u751a\u81f3 powershell 5 \u4e5f\u4e0d\u884c\u3002

\n

\u6211\u77e5\u9053 ps \u7ba1\u9053\u53ef\u4ee5\u4f20 PS-Object\uff0c\u4f46\u4e0d\u4f1a\u4e0d\u4f1a\u517c\u5bb9\u6587\u4ef6\u6d41\u5427\uff0c\u76ee\u524d\u8fd8\u6ca1\u627e\u5230\u8bf4\u8fd9\u4e2a\u95ee\u9898\u7684\uff0c\u5148\u5728\u8fd9\u5206\u4eab\u4e00\u4e0b\u7ee7\u7eed\u5bfb\u627e \u89e3\u51b3\u65b9\u6848\u3002

\n", "date_published": "2020-07-29T05:44:31+00:00", "title": "Powershell \u7684\u7ba1\u9053\u517c\u5bb9\u6027", "id": "t/694017" }, { "author": { "url": "member/ps1aniuge", "name": "ps1aniuge", "avatar": "https://cdn.v2ex.com/gravatar/303b7d8de36ac5f4a282399ec24adeb0?s=73&d=retro" }, "url": "t/678918", "title": "powershell \u7684\u72ec\u95e8\u79d8\u6280\u4e4b\u6c14\u8fd0\u201c\u4e39\u7530\u201d", "id": "t/678918", "date_published": "2020-06-05T04:26:20+00:00", "content_html": "powershell \u6709\u7ba1\u9053\u7b26\u201c|\u201d\uff0c\u7ba1\u9053\u7684\u4e24\u7aef\uff0c\u53ef\u4ee5\u4f20\u9012 powershell \u5bf9\u8c61\u3002\u8fd9\u662f\u54b1\u5bb6\u72ec\u95e8\u79d8\u6280\u3002

\u82e5\u6ca1\u6709 [\u7ba1\u9053\u4e24\u7aef\u4f20\u5bf9\u8c61] \uff0c\u8fd9\u6761\u547d\u4ee4\u5c31\u65e0\u6cd5\u8fd0\u884c\u3002
dir |where-object { $_.length -gt 1000} #\u8fd4\u56de\u5927\u4e8e 1000 \u5b57\u8282\u7684\u6587\u4ef6\u3002

[\u7ba1\u9053\u4e24\u7aef\u4f20\u5bf9\u8c61] \u76f8\u5f53\u4e8e ps \u4e4b\u4eba\u7684 [\u4e39\u7530] \uff0c\u7ec3 ps \u6b66\u529f\u7684\u6839\u57fa\u3002\u53ea\u9700\u8981\u6253\u574f\u7ec3\u6b66\u4e4b\u4eba\u7684 [\u4e39\u7530] \uff0c\u5c31\u53ef\u4ee5\u5e9f\u4ed6 9 \u6210\u6b66\u529f\u3002


\u6211\u628a [ win\uff0clinux \u811a\u672c\u7528\u6237] \uff0c\u6bd4\u55bb\u6210\u201c\u5973\u4eba\u201d\uff0c
\u6211\u628a [\u7ba1\u9053\u4f20\u9012\u5bf9\u8c61] \uff0c\u6bd4\u55bb\u6210\u201c\u7f8e\u989c\u76f8\u673a\u201d\u3002

\u5728 win7 \u4e2d\u6709 ps \u7ba1\u9053\u4f20\u9012\u5bf9\u8c61\u529f\u80fd\u3002\u8fd9\u4e2a\u201c\u7f8e\u989c\u76f8\u673a\u201d\uff0c\u53ef\u4ee5\u88ab\u770b\u505a\u65e9\u671f\u7684\uff0c\u529f\u80fd\u7b80\u964b\u7684\uff0c\u9ad8\u7aef\u7528\u6237\u624b\u4e2d\u7684\u73a9\u5177\u3002
\u968f\u7740\u65f6\u95f4\u63a8\u79fb\uff0c\u968f\u7740 2020 \u5e74 1 \u6708 14 \u65e5 win7 \u7684 eol \uff1b\u968f\u7740 win10 \u7684\u4e0a\u4f4d\u666e\u53ca\uff1b\u968f\u7740\u9ad8\u7ea7\u624b\u673a\u7684\u666e\u53ca\uff1b
powershell \u5728 win \u4e2d\u65e0\u654c\u4e86\u3002\u4ee3\u8868\u201c\u7f8e\u989c\u76f8\u673a\u201d\u7684\u7ba1\u9053\u4f20\u9012\u5bf9\u8c61\u529f\u80fd\u666e\u53ca\u4e86\u3002

\u73b0\u5728\u6bcf\u4e2a\u201cwin \u5973\u4eba\u201d\u624b\u91cc\u90fd\u62ff\u7740\u201c\u7f8e\u989c\u76f8\u673a\u201d\u7248\u624b\u673a\u3002\u5f53\u7136\uff0c\u7f8e\u989c\u76f8\u673a\u4e5f\u53ef\u4ee5\u5173\u6389\u4e0d\u7528\u3002\u53ea\u7528\u7ba1\u9053\u4f20\u9012\u5b57\u7b26\u4e32\u3002

\u8fd9\u6837\u7684\u201cwin \u5973\u4eba\u201d\uff0c\u5360\u6240\u6709\u5973\u4eba\u7684 89%\uff08\u4e16\u754c\u4e0a win \u7528\u6237\u5927\u6982\u6709 89%\u8fd9\u4e2a\u6837\u5b50\uff09

\u73b0\u5728\u6bcf\u4e2a\u201clinux \u5973\u4eba\u201d\uff0c\u624b\u91cc\u7684\u9ed8\u8ba4\u624b\u673a\uff08 bash\uff0czsh \uff09\u90fd\u4e0d\u80fd\u7f8e\u989c\u3002\u4f46\u8fd9\u4e9b linux \u5973\u4eba\uff0c\u53ef\u4ee5\u4e00\u952e\u5b89\u88c5\u5f00\u6e90\u514d\u8d39\u7684 powershell \uff08\u7f8e\u989c\u76f8\u673a\uff09\u8be6\u89c1 https://gitee.com/chuanjiao10/kasini3000_agent_linux

\u73b0\u5728\u77e5\u4e4e\u4e0a\u6709\u4eba\u8bf4\u201cpowershell \u53d1\u660e\u7684\u7ba1\u9053\u4f20\u5bf9\u8c61\uff0c\u6ca1\u524d\u9014\u4e0d\u53ef\u884c\u201d\u3002\u88ab\u6211\u7c7b\u6bd4\u4e3a\u201c\u7f8e\u989c\u76f8\u673a\u662f\u5e7a\u86fe\u5b50\uff0c\u6ca1\u524d\u9014\uff0c\u5973\u4eba\u4e0d\u5e94\u8be5\u7528\u201d\u3002

\u5b9e\u9645\u4e0a\uff0c\u6211\u5f88\u8ba8\u538c\u5973\u4eba\u7528\u7f8e\u989c\u76f8\u673a\uff0c\u5979\u4eec\u7b80\u76f4\u662f\u201c\u5bb9\u8c8c\u8bc8\u9a97\u72af\u201d\uff0c\u6b3a\u9a97\u4e86\u6211\u7684\u773c\u775b\u548c\u611f\u60c5\u3002\u6211\u5bf9\u8001\u5a46\u8fd9\u6837\u4e00\u8bf4\uff0c\u7ed3\u679c\u88ab\u5979\u4e00\u811a\u8e22\u4e0b\u4e86\u5e8a\u3002

\u53ef\u89c1\u201c\u5973\u4eba\u4eec\u201d\u5e76\u4e0d\u8fd9\u4e48\u60f3\u3002\u6bd4\u5982\uff1a
vmware \u6709\u4e24\u79cd\u7ba1\u7406\u547d\u4ee4\u884c\uff0c\u4e00\u79cd\u662f\u57fa\u4e8e linux \u7684\uff0c\u4e00\u79cd\u662f\u57fa\u4e8e powershell \u7684 powercli \u3002\u5f88\u663e\u7136 powercli \u6bd4\u57fa\u4e8e linux \u7684\u7b80\u5355\u5f3a\u5927\u3002
\u8fd9\u91cc\u9762\u5c11\u4e0d\u4e86\u7ba1\u9053\u4f20\u5bf9\u8c61\uff0c\u8fd9\u4e2a\u201c\u7f8e\u989c\u76f8\u673a\u201d\u7684\u529f\u80fd\u3002

\u4f60\u8bf4\uff1a\u201c [\u7ba1\u9053\u4e24\u7aef\u4f20\u5bf9\u8c61] \u4e0d\u884c\u201d\u3002
\u6211\u8bf4\uff1a\u201c\u4e3a\u5565\u4ee5 shell \u7684\u6807\u51c6\u770b powershell \uff1f\u201d
\u7ba1\u9053\u4f20\u5bf9\u8c61\u5230\u5e95\u884c\u4e0d\u884c\uff1f\u6211\u8bf4\u884c\uff0c\u4f60\u8bf4\u4e0d\u884c\uff0c\u5230\u5e95\u770b\u597d\u4e0d\uff1f\u8d70\u7740\u77a7\u5457\u3002

\u624b\u673a\u5382\u5bb6\uff0c\u5e26\u7740\u7f8e\u989c\u76f8\u673a\uff0c\u5df2\u7ecf\u5f81\u670d\u4e16\u754c\u4e0a\u7edd\u5927\u591a\u6570\u5973\u4eba\u3002\u4e54\u78a7\u841d\u90fd\u80fd\u7ed9\u4f60\u641e\u6210\u53ef\u7231\u5927\u773c\u840c\uff1b\u795b\u6591\u51cf\u76b1\u7eb9\uff0c\u8001\u592a\u592a\u7528\u4e86\u90fd\u8bf4\u597d

powershell \u5e26\u7740\u7ba1\u9053\u4f20\u5bf9\u8c61\uff0c\u5f81\u670d\u5927\u591a\u6570 linux \u7528\u6237\uff0c\u8fd8\u8fdc\u5417\uff1f" }, { "author": { "url": "member/ps1aniuge", "name": "ps1aniuge", "avatar": "https://cdn.v2ex.com/gravatar/303b7d8de36ac5f4a282399ec24adeb0?s=73&d=retro" }, "url": "t/664697", "title": "powershell \u7684 tab \u53c2\u6570\u8865\u5168\u7684\uff0c\u4e24\u4e2a\u4e0d\u540c\u65b9\u5f0f\u8be6\u89e3\u3002", "id": "t/664697", "date_published": "2020-04-21T08:34:08+00:00", "content_html": "powershell \u7684 tab \u53c2\u6570\u8865\u5168\uff0c\u6709\u4e24\u4e2a\u65b9\u5f0f\uff1a\u4e00\u79cd\u662f linux \u7684\uff0c\u4e00\u79cd\u662f win \u7684\u3002

\u9ed8\u8ba4\u503c\uff1awin \u7528 win \u7684 tab \u8865\u5168\u3002\u8fd9\u79cd\u662f\uff1a\u5148\u6309\u201c-\u201d\uff0c\u7136\u540e\u6309\u201ctab\u201d\uff0c\u8865\u5168\u51fa\u7b2c\u4e00\u4e2a\u53c2\u6570\u540d\uff0c\u6216\u6240\u9009\u5b57\u6bcd\u6253\u5934\u7684\u53c2\u6570\u540d\u3002\u518d\u6309 tab\uff0c\u8865\u5168\u51fa\u7b2c\u4e8c\u4e2a\u53c2\u6570\u540d\u3002
\u9ed8\u8ba4\u503c\uff1alinux \u7528\u7c7b\u4f3c bash \u7684 tab \u8865\u5168\u3002\u8fd9\u79cd\u662f\uff1a\u5148\u6309\u201c-\u201d\uff0c\u7136\u540e\u6309\u4e24\u6b21\u201ctab\u201d\uff0c\u5217\u51fa\u6240\u6709\u53c2\u6570\u540d\uff0c\u6216\u6240\u9009\u5b57\u6bcd\u6253\u5934\u7684\u53c2\u6570\u540d\u3002

linux \u7248 ps\uff0c\u82e5\u60f3\u6539\u53d8\u6210\u517c\u5bb9 win \u4e5f\u5bb9\u6613\uff1a
1 \u5efa\u7acb$profle \u3002
pwsh -c 'mkdir -p \"$env:HOME/.config/powershell\" '
2 \u5199\u5165 psreadline \u9009\u9879\u3002
pwsh -c 'Add-Content -Value \"Set-PSReadlineOption -EditMode Windows\" -LiteralPath $profile ' #\u517c\u5bb9 win" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/663224", "title": "\u5728 PowerShell \u4e2d\u597d\u597d\u8bf4\u8bdd", "id": "t/663224", "date_published": "2020-04-16T14:17:00+00:00", "content_html": "

\u9996\u5148\u611f\u8c22 @wsph123 \u63d0\u4f9b\u7684\u670d\u52a1\uff0c\u5f81\u5f97\u4f5c\u8005\u540c\u610f\u540e\u53d1\u51fa\u3002
\n\u5728 Mac \u4e0a\u4e5f\u4f1a\u7ecf\u5e38\u7528wtf\u67e5\u4e00\u4e9b\u7f29\u5199\uff0c\u73b0\u5728\u6709\u4e86\u4e2d\u6587\u7684\uff0c\u4e0d\u80dc\u6b23\u559c\u3002\u5bf9\u4e8e\u5e38\u7528\u7528\u547d\u4ee4\u884c\u7684\u540c\u5b66\u6765\u8bf4\uff0c\u53bb web \u91cc\u67e5\u627e\u7565\u663e\u70e6\u7410\uff0c\u56e0\u6b64\u5199\u4e86\u4e2a PowerShell \u51fd\u6570\uff0c\u65b9\u4fbf\u4f7f\u7528\u3002

\n

Talk is cheap!
\nhttps://paste.ubuntu.com/p/3dRsf4krbb/ (Expired in a week)

\n

\"\"

\n

\u8bed\u6cd5\u9519\u8bef\u4e0d\u8981\u8bf4\u51fa\u6765\uff0c\u6bd4\u5982a\u3001an\u3002\u3002\u3002\u7ed9\u4e2a\u9762\u5b50\u54e6\ud83d\ude48

\n" }, { "author": { "url": "member/h404bi", "name": "h404bi", "avatar": "https://cdn.v2ex.com/avatar/843a/bb98/122718_large.png?m=1727803948" }, "url": "t/654386", "title": "\u5728 PowerShell \u4e2d\u4f7f\u7528 fish-style \u81ea\u52a8\u8865\u5168\u63d0\u793a", "id": "t/654386", "date_published": "2020-03-19T13:22:08+00:00", "content_html": "

\"fish-pwsh\"

\n" }, { "author": { "url": "member/raawaa", "name": "raawaa", "avatar": "https://cdn.v2ex.com/avatar/2e4b/0a43/125815_large.png?m=1650534950" }, "url": "t/648742", "date_modified": "2020-02-29T19:51:16+00:00", "content_html": "

\u53cc\u7cfb\u7edf\u5207\u6362\u6765\u5207\u6362\u53bb\u8fd8\u662f\u633a\u9ebb\u70e6\u7684\u3002\u52a0\u4e0a Windows Terminal + PowerShell \u7684\u4f53\u9a8c\u8d8a\u6765\u8d8a\u597d\u4e8e\u662f\u53bb\u5e74\u5e74\u5e95\u628a Arch Linux \u5f7b\u5e95\u5378\u6389\u4e86\u3002\u672c\u8eab\u4e0d\u662f\u4e13\u4e1a\u7684\uff0c\u5728\u7ec8\u7aef\u91cc\u6700\u591a\u5c31\u662f\u6279\u5904\u7406\u4e00\u4e0b\u6587\u4ef6\uff0cPowerShell \u5f00\u7bb1\u5373\u7528\u867d\u7136\u633a\u7cdf\u7cd5\uff0c\u4f46\u662f\u8c03\u6559\u4e00\u4e0b\u8fd8\u662f\u591f\u7528\u4e86\u3002

\n

PSReadLine

\n

PSReadLine \u662f PowerShell \u7684\u5b98\u65b9\u6a21\u5757\uff0c\u4e3a PowerShell \u63d0\u4f9b\u4e86\u7f3a\u5931\u7684\u4ea4\u4e92\u7279\u6027\u3002\u4f8b\u5982\u50cf zsh/fish \u90a3\u6837\u7684\u4ea4\u4e92\u5f0f\u7684\u8865\u5168\u3001\u8bed\u6cd5\u9ad8\u4eae\u3001emacs \u6309\u952e\u6a21\u5f0f\u7b49\u7b49\u3002\u6709\u4e86 PSReadLIne \u4e4b\u540e\u7684 PowerShell \u624d\u7ec8\u4e8e\u50cf\u70b9\u6837\u4e86\u3002

\n

\u5b89\u88c5\uff08\u8be6\u89c1\u5b98\u65b9\u9879\u76ee README\uff09\uff1a

\n
Install-Module PSReadLine\n
\n

\u5b89\u88c5\u4e4b\u540e\uff0cPSReadLine \u7684\u4e00\u4e9b\u7279\u6027\u5e76\u4e0d\u4f1a\u81ea\u52a8\u542f\u7528\uff0c\u53ef\u4ee5\u5728 PowerShell \u7684 profile \u914d\u7f6e\u6587\u4ef6\u91cc\u81ea\u5df1\u6309\u9700\u914d\u7f6e\u3002\u4f46\u662f\u81ea\u5df1\u4ece\u5934\u641e\u6bd5\u7adf\u5f88\u70e6\uff0c\u76f4\u63a5\u767d\u5ad6\u5b98\u65b9\u63d0\u4f9b\u7684\u914d\u7f6e\u6837\u4f8b\u5c31\u53ef\u4ee5\uff0c\u5df2\u7ecf\u975e\u5e38\u597d\u7528\u4e86\u3002

\n

posh-git \u4e0e oh-my-posh

\n

posh-git \u53ef\u4ee5\u4e3a PowerShell \u63d0\u4f9b git \u547d\u4ee4\u8865\u5168\u3002oh-my-posh \u53ef\u4ee5\u7f8e\u5316 prompt\uff0c\u63d0\u4f9b\u5404\u79cd\u4e3b\u9898\u3002\u76f4\u63a5\u628a\u4e24\u4e2a\u4e00\u8d77\u5b89\u4e0a:

\n
Install-Module posh-git -Scope CurrentUser\nInstall-Module oh-my-posh -Scope CurrentUser\n
\n

\u5728 profile \u914d\u7f6e\u6587\u4ef6\u4e2d\u542f\u7528\u6a21\u5757\u5e76\u9009\u62e9 prompt \u6837\u5f0f\u4e3b\u9898\uff1a

\n
Import-Module posh-git\nImport-Module oh-my-posh\nSet-Theme Powerlevel10k-Lean\n
\n

Windows Terminal \u7f8e\u5316

\n

\u4e3b\u8981\u662f\u914d\u7f6e\u5b57\u4f53\u548c\u914d\u8272\u65b9\u6848\u3002\u914d\u8272\u65b9\u6848\u53ef\u4ee5\u5728 iTerm2-Color-Schemes \u8fd9\u4e2a\u9879\u76ee\u4e2d\u6311\u9009\u3002\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22 Gruvbox Dark \u914d\u8272\u3002

\n

\"Gruvbox

\n

\u5728 Windows Terminal \u914d\u7f6e\u6587\u4ef6\u4e2d\u52a0\u5165 Gruvbox Dark \u914d\u8272\u65b9\u6848\u3002

\n
\"schemes\": [\n {\n \"name\": \"Gruvbox Dark\",\n \"black\": \"#1e1e1e\",\n \"red\": \"#be0f17\",\n \"green\": \"#868715\",\n \"yellow\": \"#cc881a\",\n \"blue\": \"#377375\",\n \"purple\": \"#a04b73\",\n \"cyan\": \"#578e57\",\n \"white\": \"#978771\",\n \"brightBlack\": \"#7f7061\",\n \"brightRed\": \"#f73028\",\n \"brightGreen\": \"#aab01e\",\n \"brightYellow\": \"#f7b125\",\n \"brightBlue\": \"#719586\",\n \"brightPurple\": \"#c77089\",\n \"brightCyan\": \"#7db669\",\n \"brightWhite\": \"#e6d4a3\",\n \"background\": \"#1e1e1e\",\n \"foreground\": \"#e6d4a3\"\n }\n]\n
\n

\u5728 PowerShell \u7684 profile \u90e8\u5206\u9009\u62e9 Gruvbox Dark \u4f5c\u4e3a\u914d\u8272\u65b9\u6848\u3002\u540c\u65f6\u505a\u4e00\u4e9b\u5176\u4ed6\u8c03\u6574\uff08\u56e0\u4e3a Windows Terminal \u652f\u6301\u5b57\u4f53 ligature\uff0c\u6240\u4ee5\u9009\u62e9\u4e86 Fira Code \u5b57\u4f53\uff09\uff1a

\n
{\n // Make changes here to the powershell.exe profile\n \"guid\": \"{61c54bbd-c2c6-5271-96e7-009a87ff44bf}\",\n \"name\": \"Windows PowerShell\",\n \"commandline\": \"powershell.exe\",\n \"hidden\": false,\n \"fontFace\": \"Fira Code\", \n \"fontSize\": 11,\n \"colorScheme\": \"Gruvbox Dark\",\n \"cursorShape\": \"vintage\"\n}\n
\n

\"\u6700\u7ec8\u6548\u679c\"

\n", "date_published": "2020-02-29T19:50:56+00:00", "title": "PowerShell \u4e0e Windows Terminal \u589e\u5f3a\u914d\u7f6e", "id": "t/648742" }, { "author": { "url": "member/YOOHUU", "name": "YOOHUU", "avatar": "https://cdn.v2ex.com/avatar/57ca/af93/336998_large.png?m=1660094694" }, "url": "t/647802", "date_modified": "2020-02-26T11:38:34+00:00", "content_html": "

\u7f51\u4e0a\u641c\u5230\u7684\u4e00\u4e2a\u811a\u672c\u6559\u7a0b, \u94fe\u63a5\u5982\u4e0b:
\nhttps://virtualcornerstone.com/2018/04/09/use-powercli-to-manage-users-on-an-esxi-host/

\n

\u672c\u6765\u6253\u7b97\u76f4\u63a5\u62ff\u6765\u7528\u7684, \u770b\u8fd9\u8001\u54e5\u7684\u7528\u6cd5\u6211\u5c31\u76f4\u63a5\u61f5\u903c\u4e86\n\"\"

\n

\u7ffb\u4e86\u4e0b\u811a\u672c\u4ee3\u7801, \u8fd9\u4e2a\u65b9\u6cd5\u5728\u811a\u672c\u91cc\u9762, \u53ef\u600e\u4e48\u76f4\u63a5\u8c03\u7528\u8d77\u6765\u7684? powershell \u83dc\u9e21\u4e00\u679a, \u6765\u8bf7\u6559\u4e0b\u5927\u4f6c

\n", "date_published": "2020-02-26T11:38:24+00:00", "title": "\u600e\u4e48\u628a\u4e00\u4e2a\u811a\u672c\u65b9\u6cd5\u6ce8\u518c\u4e3a\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf?", "id": "t/647802" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/636305", "title": "\uff01\u5fae\u8f6f\u53c8\u653e\u9e3d\u5b50\u4e86\uff01", "id": "t/636305", "date_published": "2020-01-08T14:49:11+00:00", "content_html": "

\u4eca\u5929\u4e0a\u5348\uff0c\u5fae\u8f6f PowerShell \u56e2\u961f\u7ecf\u7406Steve Lee\u53d1\u63a8\u79f0\uff1a

\n
\n

\u5728\u5bf9 PowerShell 7.0 RC1 \u7684\u6240\u6709\u5df2\u5408\u5e76 PR \u5206\u7c7b\u540e\uff0c\u6211\u4eec\u5df2\u7ecf\u51b3\u5b9a\u62df\u5728\u4e0b\u5468\u53d1\u5e03\u4e2a RC2\u3002GA \u6709\u671b\u5728\u4e8c\u6708\u65e9\u671f\u53d1\u5e03\u3002
\n\u4f60\u9e3d\u4f60\u6709\u7406

\n
\n

\"\"

\n

\u7ad9\u5728\u4ea7\u54c1\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u4e5f\u7b97\u662f\u4e2a\u597d\u4e8b\u5427\u3002

\n" }, { "author": { "url": "member/ps1aniuge", "name": "ps1aniuge", "avatar": "https://cdn.v2ex.com/gravatar/303b7d8de36ac5f4a282399ec24adeb0?s=73&d=retro" }, "url": "t/632549", "title": "\u5206\u4eab powershell ssh to Linux \u811a\u672c\u3002", "id": "t/632549", "date_published": "2019-12-26T06:42:55+00:00", "content_html": "------\u6982\u8ff0-----

win \u8fde\u63a5 linux\uff0c\u6709 3 \u79cd\u60c5\u51b5\u3002
1 win \u7684 cmd to linux \u7684 bash
2 win \u7684 powershellv6\uff0cv7 to linux \u7684 bash
3 win \u7684 powershellv6\uff0cv7 to linux \u7684 powershell\u3002



------\u8bb2\u89e3\u4e0a\u8ff0\u60c5\u51b5 2-----
\u5728 powershell \u4e2d\u8fd0\u884c\uff1assh root@ip
\u5728 win term \u4e2d\u7f16\u5199

\"commandline\" : \"C:\\\\Program Files\\\\PowerShell\\\\7-preview\\\\pwsh.exe -noexit -command 'ssh root@ip' \",


------\u8bb2\u89e3\u4e0a\u8ff0\u60c5\u51b5 3-----
3.1 \u811a\u672c\u4e0b\u8f7d\u5730\u5740\uff1a
powershell \u5165\u95e8\u8d44\u6599\u4e0b\u8f7d\uff1a\u542b\u7edd\u5927\u591a\u6570\u7535\u5b50\u4e66\uff0c\u5165\u95e8\u57fa\u7840\u8d44\u6599\u3002
https://pan.baidu.com/s/1p2zK-BewhursJxDNQnq5PQ



3.2 \u9700\u6c42\uff1a
\u9700\u8981 linux \u4e2d\u5b89\u88c5 powershell,\u5e76\u6539\u5199 sshd \u914d\u7f6e\u6587\u4ef6\u3002
\u9700\u8981\u5148\u914d\u597d sshkey\u3002

3.3 \u811a\u672c\u7528\u9014\uff1a

3.3.1 \u5728 powershell v6\uff0cv7 \u4e2d\uff0c\u76f4\u63a5\u8fd0\u884c ssh_to_centos7.ps1 \uff0c\u53ef\u4ee5\u8fdb\u5165 linux powershell \u547d\u4ee4\u884c\u3002

3.3.2 \u5efa\u8bae\u6539\u5199 win term \u6807\u7b7e\u914d\u7f6e\u6587\u4ef6\u3002
{
\"acrylicOpacity\" : 0.5,
\"closeOnExit\" : true,
\"colorScheme\" : \"Campbell\",
\"tabTitle\" : \"ps62\",
\"commandline\" : \"C:\\\\Program Files\\\\PowerShell\\\\7-preview\\\\pwsh.exe -noexit -file d:\\\\ps\\\\ssh_to_centos7.ps1\",
\"scrollbarState\": \"visible\",
\"cursorColor\" : \"#FFFFFF\",
\"cursorShape\" : \"bar\",
\"fontFace\" : \"Monaco_YH_Nero_Mono\",
\"fontSize\" : 18,
\"guid\" : \"{c3d2cb60-5f6d-4e83-89ee-eec17960fc9a}\",
\"historySize\" : 9001,
\"icon\" : \"ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png\",
\"name\" : \"PowerShell Core 7\",
\"padding\" : \"0, 0, 0, 0\",
\"snapOnInput\" : true,
\"startingDirectory\" : \"c:\\\\ProgramData\\\\kasini3000\",
\"backgroundImage\": \"d:\\\\ps \u58c1\u7eb8.jpg\",
\"backgroundImageAlignment\": \"center\",
\"backgroundImageAlignment\": \"uniformToFill\",
\"backgroundImageOpacity\" : 0.2
},

\u7f16\u5199\u5e76\u4fdd\u5b58\u540e\uff0c\u70b9\u51fb win term \u6807\u7b7e\uff0c\u5373\u53ef\u6253\u5f00\u8fdc\u7a0b\u7ec8\u7aef\uff0c\u57fa\u672c\u53ef\u4ee5\u4ee3\u66ff\u7ec8\u7aef\u8f6f\u4ef6\u3002" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/629879", "title": "PowerShell Core 7.0 RC \u5df2\u7ecf\u53d1\u5e03", "id": "t/629879", "date_published": "2019-12-17T09:12:26+00:00", "content_html": "

Joey Aiello \uff08 PowerShell \u56e2\u961f PM \uff09\u5728\u5fae\u8f6f\u7684\u5f00\u53d1\u8005\u535a\u5ba2\u4e0a\u5ba3\u5e03 PowerShell 7.0 \u7684 RC \u7248\u672c\u53d1\u5e03\uff0c\u5e76\u516c\u5e03\u5c06\u5728\u4e0b\u4e2a\u6708\u53d1\u5e03 GA\u3002

\n

PowerShell 7.0 \u5bf9\u5e7f\u5927 Windows \u5e73\u53f0\u7684 PowerShell \u7528\u6237\u6765\u8bf4\uff0c\u6700\u60ca\u8273\u7684\u83ab\u8fc7\u4e8e Out-GridView \u547d\u4ee4\u7684\u56de\u5f52\uff0c\u540c\u65f6 Joey \u4e5f\u5217\u4e86\u4e00\u4e9b\u529f\u80fd\u5356\u70b9\uff1a

\n
\n\n
\n" }, { "author": { "url": "member/yukinotech", "name": "yukinotech", "avatar": "https://cdn.v2ex.com/gravatar/437a1185acbac54c9697174637cb0b49?s=73&d=retro" }, "url": "t/622499", "date_modified": "2019-11-23T17:39:45+00:00", "content_html": "\u6700\u8fd1\u4e00\u76f4\u9047\u5230\u4e00\u4e2a powershell \u5f88\u8be1\u5f02\u7684\u95ee\u9898\u3002\u60f3\u548c\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u3002

\u5148\u8bf4\u81ea\u5df1\u7684\u7248\u672c\uff0c\u7248\u672c\u975e\u5e38\u4f4e\u7684 win10 \u4e13\u4e1a\u7248\uff0c\u56e0\u4e3a\u6bd4\u8f83\u538c\u6076\u5347\u7ea7\uff0c\u5df2\u7ecf\u5173\u4e86\u81ea\u52a8\u66f4\u65b0 2,3 \u5e74\u4e86\u3002\u81f3\u4eca\u6211\u7684\u4efb\u52a1\u7ba1\u7406\u5668\u4ecd\u7136\u4e0d\u80fd\u663e\u793a GPU\u3002\u3002

\u56de\u5230\u6b63\u9898\uff0c\u662f\u4e00\u4e2a\u4ec0\u4e48\u95ee\u9898\u5462\uff1f\u5c31\u662f powershell \u4f1a\u5361\u4f4f\uff0c\u7136\u540e ctrl+c \u4e00\u4e0b\u5c31\u4e0d\u5361\u4e86\u3002\u3002

2 \u4e2a\u4f8b\u5b50
1. \u7528 youtube-dl \uff08\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff09\u4e0b\u89c6\u9891\u65f6\uff0c\u6709\u65f6\u5019\u4f1a\u5361\u4f4f\uff0cshell \u91cc\u663e\u793a\u7684\u901f\u5ea6\u548c\u5df2\u4e0b\u8f7d\u4e00\u76f4\u5361\u4f4f\u4e0d\u52a8\uff0c\u8fd9\u65f6\u5019 ctrl+c \u4e00\u4e0b\uff0c\u5c31\u9a6c\u4e0a\u4e0d\u5361\u4e86

2.\u81ea\u5df1\u5199\u7684\u4e00\u4e2a http \u4ee3\u7406\u6a21\u5757\uff0c\u5728\u8bbf\u95ee\u5230\u7f51\u9875\u65f6\u4f1a\u6253 log\u3002\u4ee3\u7406\u7a0b\u5e8f\u662f\u7528 powershell \u5728\u547d\u4ee4\u884c\u8d77\u7684\u3002\u7528\u8fd9\u4e2a\u4ee3\u7406\u8bbf\u95ee\u7f51\u9875\u6709\u65f6\u5019\u4f1a\u4e00\u76f4\u8f6c\uff0c\u52a0\u8f7d\u4e0d\u51fa\u6765\u3002\u7136\u540e\u4f1a\u53d1\u73b0 log \u5728 powershell \u6ca1\u6253\u51fa\u6765\u3002\u8fd9\u65f6\u5019 ctrl+c \u4e00\u4e0b\uff0clog \u5237\u7684\u4e00\u4e0b\u5c31\u6253\u51fa\u6765\u4e86\u3002\u7f51\u9875\u4e5f\u8fdb\u53bb\u4e86\u3002

\u6709\u6ca1\u6709\u5927\u795e\u8d50\u6559\uff0c\u8fd9\u662f\u5565\u95ee\u9898\uff1f", "date_published": "2019-11-23T13:57:19+00:00", "title": "powershell \u4e00\u4e2a\u5f88\u8be1\u5f02\u7684\u95ee\u9898", "id": "t/622499" }, { "author": { "url": "member/ps1aniuge", "name": "ps1aniuge", "avatar": "https://cdn.v2ex.com/gravatar/303b7d8de36ac5f4a282399ec24adeb0?s=73&d=retro" }, "url": "t/617147", "title": "powershell \u7684 ntp \u6821\u65f6\u811a\u672c\uff0c\u5149\u68cd\u8282\u79d2\u6740\u4e13\u7528\uff01", "id": "t/617147", "date_published": "2019-11-07T03:21:10+00:00", "content_html": "win+powershell+get-ntpdate.ps1
\u7ba1\u7406\u5458\u6743\u9650\u8fd0\u884c\uff0c

11 \u6708 7 \u65e5\u662f\u4eac\u4e1c\u53cc 11\u201c\u7535\u8111\u6570\u7801\u72c2\u6b22\u65e5\u201d\uff0c\u4eac\u4e1c\u4e3a\u5728\u8fd9\u4e00\u5929\u8d2d\u4e70\u7535\u8111\u7684\u7f51\u53cb\u7ed9\u51fa\u4e86\u56db\u4e2a\u79d2\u6740\u65f6\u95f4\u8282\u70b9\uff0c\u5206\u522b\u662f 0 \u70b9\uff0c10 \u70b9\uff0c16 \u70b9\u548c 20 \u70b9\uff0c\u90e8\u5206\u7b14\u8bb0\u672c\u7535\u8111\u548c NAS \u8bbe\u5907\u751a\u81f3\u6709\u5343\u5143\u4ee5\u4e0a\u7684\u964d\u4ef7\u5e45\u5ea6\u3002

\u6211\u7684\u6240\u6709 powershell \u811a\u672c\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a
https://pan.baidu.com/s/16deKKe3ZnCg809lffiVZWg

\u6b22\u8fce\u6536\u85cf\uff0c\u7ed9\u6211\u94dc\u5e01\u3002" }, { "author": { "url": "member/wwwwzf", "name": "wwwwzf", "avatar": "https://cdn.v2ex.com/avatar/001e/f005/270314_large.png?m=1587975704" }, "url": "t/616379", "title": "PowerShell \u5982\u4f55\u5f3a\u884c\u8986\u76d6\u4e00\u4e2a\u6587\u4ef6", "id": "t/616379", "date_published": "2019-11-05T03:17:11+00:00", "content_html": "

PS D:\\test\\hhff> Move-Item D:\\test\\hhff/*.jpg D:\\test\\Protected\nMove-Item : \u5f53\u6587\u4ef6\u5df2\u5b58\u5728\u65f6\uff0c\u65e0\u6cd5\u521b\u5efa\u8be5\u6587\u4ef6\u3002

\n

\u79fb\u52a8\u7684\u6587\u4ef6\u5939\uff0c\u4e0e\u76ee\u6807\u6587\u4ef6\u5939\u6709\u76f8\u540c\u6587\u4ef6\u540d\u7684\u6587\u4ef6\uff0c\u5982\u4f55\u5f3a\u884c\u8986\u76d6\uff1f

\n" }, { "author": { "url": "member/wwwwzf", "name": "wwwwzf", "avatar": "https://cdn.v2ex.com/avatar/001e/f005/270314_large.png?m=1587975704" }, "url": "t/616237", "title": "\u5982\u4f55\u4f7f\u7528\u547d\u4ee4\u884c\u6216 PowerShell \u5220\u9664\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u597d\u7684\u8bc1\u4e66", "id": "t/616237", "date_published": "2019-11-04T13:29:13+00:00", "content_html": "

\u5df2\u77e5\uff0c\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\uff0c\u53ef\u4ee5\u5bfc\u5165\u4e00\u4e2a PFX \u8bc1\u4e66\uff1a\ncertutil -f -importPFX -p passwd D:\\cert\\server.pfx

\n

\u73b0\u5728\u95ee\u9898\u662f\uff0c\u5982\u4f55\u5220\u9664\u4e00\u4e2a\u5df2\u7ecf\u5bfc\u5165\u8fdb\u53bb\u7684 IIS \u8bc1\u4e66\uff0c\u6bd4\u5982 IIS \u8bc1\u4e66\u540d\u662f\uff1aName,\n\u6709\u65e0\u65b9\u6cd5\uff0c\u7528\u547d\u4ee4\u884c\u6216 PowerShell \u6765\u5220\u9664\u5b83\u3002

\n

\u7f51\u4e0a\u627e\u5230\u7684\u65b9\u6cd5\u662f\u91c7\u7528\nCertUtil [\u9009\u9879] -delstore CertificateStoreName CertId\n\u6765\u5220\u9664\uff0c\u4f46\u65e0\u6cd5\u8bfb\u5230 CertificateStoreName \u4e0e CertId\uff0c\u4e5f\u5c31\u6ca1\u6709\u529e\u6cd5\u4e86\uff0c\u8bf7\u6c42\u534f\u52a9\u3002

\n" }, { "author": { "url": "member/wwwwzf", "name": "wwwwzf", "avatar": "https://cdn.v2ex.com/avatar/001e/f005/270314_large.png?m=1587975704" }, "url": "t/615532", "title": "PowerShell \u5982\u4f55\u5bfc\u5165\u5df2\u6709\u7684 SSL \u8bc1\u4e66", "id": "t/615532", "date_published": "2019-11-02T04:43:38+00:00", "content_html": "

\u4e00\u4e2a IIS \u5bfc\u51fa\u7684 SSL \u5b89\u5168\u8bc1\u4e66\uff0c\u5982\u540d\u53eb\uff1atest.pfx\n\u5b83\u5305\u542b\u5bc6\u7801\uff0c\u6bd4\u5982\u53eb\uff1a123456

\n

\u5982\u4f55\u7528 powershell \u5c06\u4ed6\u5bfc\u5230\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u5462\uff1f\n\u56e0\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u662f windows core \u6a21\u5f0f\uff0c\u6ca1\u6709\u89c6\u7a97\u754c\u9762\uff0c\u7136\u540e\u5361\u5728\u8fd9\u4e0a\u9762\u4e86\uff0c\u545c\u545c\uff0c\u6c42\u5927\u4f6c\u5e2e\u5fd9\u3002

\n" }, { "author": { "url": "member/wwwwzf", "name": "wwwwzf", "avatar": "https://cdn.v2ex.com/avatar/001e/f005/270314_large.png?m=1587975704" }, "url": "t/615502", "title": "PowerShell \u5982\u4f55\u5b9a\u4e49\u6587\u4ef6\u5939\u7684\u6743\u9650", "id": "t/615502", "date_published": "2019-11-02T02:59:57+00:00", "content_html": "

icacls D:\\test\\gg* /grant[:r] Users:F /t #\u8986\u76d6\u5b50\u76ee\u5f55\u6240\u6709\u6587\u4ef6\u5b8c\u5168\u63a7\u5236

\n

\u4e0a\u9762\u547d\u4ee4\uff0c\u4ec5\u80fd\u5bf9\u6587\u4ef6\u5939\u4e2d\u7684\u6587\u4ef6\u8d77\u4f5c\u7528\uff0c\u6587\u4ef6\u5939\u672c\u8eab\u4e0d\u8d77\u4f5c\u7528\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u8bed\u6cd5\uff0c\u652f\u6301\u76f4\u63a5\u64cd\u4f5c\u6587\u4ef6\u5939\u6743\u9650\u7684\u5417\uff1f

\n

\u5e0c\u671b\u54ea\u4f4d\u5927\u54e5\u76f8\u52a9\uff1a\uff09

\n" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/599459", "title": "\u63a8\u8350\u4e00\u4e2a github \u4e0a\u7684 PowerShell \u9879\u76ee", "id": "t/599459", "date_published": "2019-09-09T15:30:44+00:00", "content_html": "

\u65e0\u610f\u4e2d\u53d1\u73b0\u4e00\u4e2aPowerShell \u7684\u9879\u76ee\uff0c\u5176\u5b83\u8bed\u8a00\u7684\u9879\u76ee\u86ee\u591a\u7684\uff0cPowerShell \u7684\u9879\u76ee\u786e\u5b9e\u4e0d\u591a\uff0c\u5373\u4fbf\u6709\uff0c\u591a\u6570\u4e5f\u662f\u811a\u672c\u5f0f\u7684\u5b58\u5728\u3002

\n

\u8fd9\u4e2a\u9879\u76ee\u770b\u4e0a\u53bb\u6c14\u52bf\u78c5\u7934\uff0c\u503c\u5f97\u5173\u6ce8\u3002

\n

\u9879\u76ee\u5730\u5740\uff1a https://github.com/chuanjiao10/kasini3000

\n" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/598656", "title": "Out-GridView \u5728 PowerShell Core \u4e2d\u56de\u5f52\u4e86", "id": "t/598656", "date_published": "2019-09-06T09:15:22+00:00", "content_html": "

\u81ea PowerShell Core \u5728 Linux \u548c Mac \u4e0a\u7684\u9996\u79c0\uff0c\u5df2\u7ecf\u5dee\u4e0d\u591a 3 \u5e74\u4e86\u3002\u4eca\u5929\uff0cOut-GridView \u901a\u8fc7GraphicalTools \u6a21\u5757\u5728\u5168\u90e8\u652f\u6301 PowerShell Core \u7684\u5e73\u53f0\u4e0a\u767b\u573a\u4e86\u3002
\n\"\"
\n\"\"
\n\"\"

\n

\u5b89\u88c5

\n

\u5982\u679c\u8981\u4f7f\u7528\uff0c\u8fd0\u884c\u4ee5\u4e0b cmdlet \u5b89\u88c5\uff1a

\n
Install-Module Microsoft.PowerShell.GraphicalTools\n
\n

\u66f4\u591a\u4fe1\u606f\u8bf7\u8bbf\u95ee\u5fae\u8f6f\u5f00\u53d1\u8005\u535a\u5ba2\uff1aOut-GridView Returns

\n" }, { "author": { "url": "member/ps1aniuge", "name": "ps1aniuge", "avatar": "https://cdn.v2ex.com/gravatar/303b7d8de36ac5f4a282399ec24adeb0?s=73&d=retro" }, "url": "t/579290", "date_modified": "2019-07-02T06:25:51+00:00", "content_html": "powershell 6\uff0c7 \u7684\u65b0\u7279\u6027\u3002
1 \u6bcf\u4e2a\u7279\u6027\u90fd\u6ce8\u660e\u4e86\u7248\u672c\u53f7\uff0c\u4ece\u8fd9\u4e2a\u7248\u672c\u5f00\u59cb\uff0c\u624d\u652f\u6301\u8fd9\u4e2a\u7279\u6027\u3002
2 \u6b22\u8fce\u6311\u6bdb\u75c5\uff0c\u8ba9\u6211\u66f4\u5b8c\u5584\u5e16\u5b50\u3002
3 \u5927\u90fd\u662f ps6 \u7684\u65b0\u7279\u6027\u3002ps7 \u521a\u521a\u5f00\u59cb\u5f00\u53d1\uff0c\u65b0\u7279\u6027\u4e5f\u53ea\u6709\u4e00\u70b9\u70b9\u3002



----------------------------------------------------------------
\u250f\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u250f\u2501\u2513\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff30\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff2f\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u79d8\u2588\u2588\u2588\u2503\uff37\u2503\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff25\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff32\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff33\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff28\u2503\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff25\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u7c4d\u2588\u2588\u2588\u2503\uff2c\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff2c\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2517\u2501\u251b\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588V6.0\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2517\u253b\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251b


\u5728 powershell 6.0 \u4e2d\u65b0\u589e\u5185\u7f6e\u53d8\u91cf
$IsCoreCLR
$IsLinux
$IsMacOS
$IsWindows
\u7528\u4e8e\u5224\u65ad\u7cfb\u7edf\u3002

#\u5047\u60f3\u4e2d\u7684\u590d\u5236\u6587\u4ef6\u811a\u672c\uff0c\u7531\u4e8e win\uff0clinux \u76ee\u5f55\u8def\u5f84\uff0c\u4e0d\u517c\u5bb9\u3002
#\u6240\u4ee5\u4f60\u8981\u5728\u4e00\u4e2a\u811a\u672c\u4e2d\uff0c\u5206\u522b\u5199 2 \u6bb5\u4ee3\u7801\u3002
if ($IsWindows)
{
\tcopy-item c:\\xxx d:\\yyy
}

if ($IsLinux)
{
\tcopy-item /home/user1 /home/user2
}



\u6211\u539f\u521b \u5206\u4eab\uff01 2016-12-02
if ($PSEdition -eq 'Desktop')
{
#win
}

if ($PSEdition -eq 'Core')
{
#linux
}
----------------------------------------------------------------
\u250f\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u250f\u2501\u2513\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff30\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff2f\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u79d8\u2588\u2588\u2588\u2503\uff37\u2503\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff25\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff32\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff33\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff28\u2503\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff25\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u7c4d\u2588\u2588\u2588\u2503\uff2c\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff2c\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2517\u2501\u251b\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588V6.0\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2517\u253b\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251b

powershell6.0 \u5373 linux \u7248\u4e2d\uff0cNew-PSSession \u65b0\u589e 3 \u4e2a\u53c2\u6570\uff0c [-HostName ] \uff0c [-UserName ] \uff0c [-KeyFilePath ] \uff0c
-SSHTransport \u5e03\u5c14\u578b \u5f3a\u5236\u4f7f\u7528 ssh \u534f\u8bae\uff0c\u800c\u4e0d\u662f winrm \u534f\u8bae
\u7528\u4e8e linux \u5ba2\u6237\u673a\uff0c\u8fde\u63a5 linux \u670d\u52a1\u5668\u3002

\u547d\u4ee4\uff1a
$\u8fde\u63a5 2 = New-PSSession -HostName 127.0.0.1 -UserName user006 #\u624b\u52a8\u8f93\u5165\u5bc6\u7801\u6216\u7528-KeyFilePath \u9009\u9879
Invoke-Command -Session $\u8fde\u63a5 2 -ScriptBlock {new-item ~/ccc.txt}

\u7528\u4e86-HostName \u53c2\u6570\u540e\uff0c\u7aef\u53e3\u9ed8\u8ba4 22\u3002
\u7528\u4e86-computername \u53c2\u6570\u540e\uff0c\u7aef\u53e3\u9ed8\u8ba4 5985\u3002
----------------------------------------------------------------
\u250f\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u250f\u2501\u2513\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff30\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff2f\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u79d8\u2588\u2588\u2588\u2503\uff37\u2503\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff25\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff32\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff33\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff28\u2503\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff25\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u7c4d\u2588\u2588\u2588\u2503\uff2c\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\uff2c\u2503\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2517\u2501\u251b\u2588\u2503
\u2523\u252b\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588V6.0\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503
\u2517\u253b\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251b
Get-Content $Path -Encoding Byte \uff08\u6216\u8bb8\u4e34\u65f6\uff09\u53d8\u66f4\u4e3a
Get-Content $Path -AsByteStream", "date_published": "2019-07-02T06:23:14+00:00", "title": "powershell 6\uff0c 7 \u7684\u65b0\u7279\u6027\u3002", "id": "t/579290" }, { "author": { "url": "member/ps1aniuge", "name": "ps1aniuge", "avatar": "https://cdn.v2ex.com/gravatar/303b7d8de36ac5f4a282399ec24adeb0?s=73&d=retro" }, "url": "t/573889", "title": "\u65b0\u51fa\u7089\u7684 ssh-copy-id6.ps1\uff0c\u662f\u65b0\u7248 vscode \u7684\u6700\u4f73\u62cd\u6863", "id": "t/573889", "date_published": "2019-06-14T04:05:46+00:00", "content_html": "vscode 1.35 \u53d1\u5e03\u4e86\uff01
\u8fd9\u4e2a\u7248\u672c\u539f\u751f\u652f\u6301\u4ece\u672c\u5730 vscode \u7ecf ssh\uff0c\u6253\u5f00\u7f16\u5199\uff0c\u4efb\u4f55\u8fdc\u7a0b\u4ee3\u7801\u3002
\u5b83\u57fa\u4e8e\u4f7f\u7528\u79d8\u94a5\u7684 ssh\u3002

\u800c\u6211\u7f16\u5199\u7684\u8fd9\u4e2a\u811a\u672c\uff0c\u4e13\u95e8\u5e2e\u52a9\u4f60\u5b9e\u73b0\uff0c\u4ece win \u53d1\u5e03\u516c\u94a5\u5230 linux\u3002" }, { "author": { "url": "member/Tumblr", "name": "Tumblr", "avatar": "https://cdn.v2ex.com/avatar/3122/ad46/344778_large.png?m=1667449277" }, "url": "t/572537", "title": "\u628a\u90a3 5000 \u591a\u4e07\u6761\u4f01\u4e1a\u6570\u636e\u653e\u5230 SQLite \u6570\u636e\u5e93\u91cc", "id": "t/572537", "date_published": "2019-06-10T09:20:16+00:00", "content_html": "

\u81f3\u4e8e\u662f\u54ea 5000 \u591a\u4e07\u6761\uff0c\u81ea\u5df1\u53bb\u627e\u5427\u3002

\n

\u9700\u8981\u5148\u5b89\u88c5 PSSQLite \u6a21\u5757\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003\u7528 PowerShell \u73a9\u8f6c SQLite \u6570\u636e\u5e93

\n
Import-Module PSSQLite\n$ent_codes_db = \"D:\\Scripts\\DB\\ent_codes.sqlite\"\n$query = \"INSERT INTO ent_codes VALUES (@name, @code, @regday, @character, @legalr, @capital, @bscope, @prov, @city, @addr)\"\nGet-ChildItem D:\\Downloads\\json\\ -Recurse -File | % {\n (Get-Content $_.fullname | ConvertFrom-Json).erDataList | % {\n $name = $_.name\n $code = $_.code\n $regday = $_.registrationDay\n $character = $_.character\n $legalr = $_.legalRepresentative\n $capital = $_.capital\n $bscope = $_.businessScope\n $prov = $_.province\n $city = $_.city\n $addr = $_.address\n Invoke-SqliteQuery -DataSource $ent_codes_db -Query $query -SqlParameters @{\n name = $name\n code = $code\n regday = $regday\n character = $character\n legalr = $legalr\n capital = $capital\n bscope = $bscope\n prov = $prov\n city = $city\n addr = $addr\n }\n }\n}\n
\n" } ] } ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86