I found some rules again:
Under the Chinese system: pscmd can support unicode characters very well, pscmd3 will generate garbled characters.
Under the English system: pscmd and pscmd3 are not very good for unicode character support.
However, using powershell ise to execute the code, in Chinese and English systems, the output is always successful, there is no garbled
Because of the garbled, many of Powershell's code can't be used in QM.
Please see the GIF demo below
Macro Macro14
Under the Chinese system: pscmd can support unicode characters very well, pscmd3 will generate garbled characters.
Under the English system: pscmd and pscmd3 are not very good for unicode character support.
However, using powershell ise to execute the code, in Chinese and English systems, the output is always successful, there is no garbled
Because of the garbled, many of Powershell's code can't be used in QM.
Please see the GIF demo below
Macro Macro14
;Under the Chinese operating system
_s=
;"letter`ttotal总空间(GB)`tAvailable space(GB)`tUsed space(GB)`tUsage rate"
;gwmi win32_logicaldisk -filter "drivetype = 3" | % {
;;;;;$_.deviceid + "`t" + `
;;;;;($_.size/1GB).tostring("f2") + "`t`t" + `
;;;;;($_.freespace/1GB).tostring("f2") + "`t`t" + `
;;;;;($_.size/1GB-$_.freespace/1GB).tostring("f2") + "`t`t" + `
;;;;;(($_.size-$_.freespace)/$_.size*100).tostring("f2") + "%"
;}
;PsCmd _s "-Version 2.0" str's ;;Output: Unicode characters are not garbled
PsCmd3 _s "" str's ;;Output: Unicode characters are garbled
mes s