powershell - 将文本文件中的内容添加到变量内容的末尾
问题描述
这是我的代码:
$tt = 'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows 消息子系统\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676'
我有一个txt文件c:\temp\reg.txt twxt文件的内容是:
00000005
然后我想将文本文件中的内容添加到变量的末尾,以便 $tt 将更新为
'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows 消息子系统\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000005'
我不知道该怎么做,或者如果你可以。
谢谢您的帮助
解决方案
像在 Unix 上一样使用命令替换:$x = "bla bla $(cat file.txt)"
推荐阅读
- s4sdk - NEO 中的租户访问器
- c# - PrecompiledMvcEngine 仍然使用共享物理视图
- c - GDB 未运行程序 (Mac OS)
- reactjs - React 通用 redux-saga 内存泄漏
- mysql - 合计 count 的总值
- c# - 在 AspNetCore OpenIdConnect 上设置 redirect_uri
- sql-server - 具有相同排序规则的两个不同 SQL Server 以两种不同的方式显示相同的十进制字段
- java - 使用 Stream API 对列表中的对象进行分组
- r - 选择要在 data.table 中保留/删除的组
- amazon-web-services - 如何使用 AWS Lambda 从 Firebase 检索数据