📌 📄 内容摘要:
thisisxiaozhu 在 powershell命令行技巧,如何在命令行实现C-c复制文件/复制文件内容的效果 中发帖
封装了一个powershell函数
function Copy-ToClipboard {
param (
[Parameter(Position = 0, Mandatory = $true)]
[string]$FilePath,
[Parameter()]
[Alias('f')]
[switch]$CopyFile
)
if (-not (Test-Path $FilePath)) {
Write-Host "[ERROR] File not found: $FilePath"
return
}
try {
if ($CopyFile) {
$absolutePath = ...
────────── 链接信息 ──────────
🔗 论坛链接: linux.do
📎 访问地址: https://linux.do/t/topic/387828/1
─────────────────────────────
📢 来源:LINUX DO