String Concatenation

$fname= New-Object psobject -Property @{
first = “C:UsersmioDesktop”
#personalise it to get the hostname and save the file with that
second = hostname
third= “.txt”
}

e.g : get-Service | Out-File “$($fname.first)$($fname.second)$($fname.third)”

Leave a Reply

Your email address will not be published. Required fields are marked *