您不能在零值表达式上调用方法

发布于 2025-02-06 14:24:50 字数 367 浏览 2 评论 0原文

我试图使用现有值替换文本文件中的一些文本。我从Azure表中获得的值并存储到变量$条目

Foreach($entry in $entries){

(Get-content) $filepath | 

for-eachobject 
{ 

$_ -replace"@Name",$entry.Name.trim()

-replace"@Class",$entry.classname.trim()

-replace "@Address",$entry.address.trim()

-replace "@Mobile",$entry.phonenumber.trim()

} | Set-content $filepath

}

I am trying to replace some texts in a text file using the existing values. The values I am getting from azure table and stored to variable $entries.

Foreach($entry in $entries){

(Get-content) $filepath | 

for-eachobject 
{ 

$_ -replace"@Name",$entry.Name.trim()

-replace"@Class",$entry.classname.trim()

-replace "@Address",$entry.address.trim()

-replace "@Mobile",$entry.phonenumber.trim()

} | Set-content $filepath

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文