you cannot call a method on a null-valued expressions

Viewed 44

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

}
0 Answers
Related