Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Set-Content cmdlet: paramater cannot be found that matches 'Encoding'

$
0
0

Hello,

I am trying to execute the following command on a server in PowerShell v4 but receive an error stating that a parameter cannot be found that matches parameter name 'Encoding'. I am using this command in a script to change the encoding of the CSV file to UTF-8. 

Get-Content -Path "X:\File.csv" | Set-Content -Path "X:\File.csv" -Encoding UTF8 -Force

The command runs fine on my local machine with PowerShell v5. The 'Encoding' parameter appears to be available in Get-Help Set-Content when I run it on the server. 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>