powershell (get-wmiobject Win32_ComputerSystemProduct).UUID生成的UUID,
01424957-1015-1419-3601-341A4C11A348
1.怎么移除“-”,
2.怎么只显示后八位
2 Answers
Best Answer
PS D:\> $uuid=(get-wmiobject Win32_ComputerSystemProduct).UUID PS D:\> $uuid 38862BD3-8621-E111-B1A9-DC0EA1737BFF PS D:\> $uuid.Replace('-','') 38862BD38621E111B1A9DC0EA1737BFF PS D:\> $uuid.Substring($uuid.Length-8) A1737BFF
你好,我用以下命令powershell (get-wmiobject Win32_ComputerSystemProduct).UUID.Replace(‘-‘,”)>uuid.txt
得到的数据uuid.txt光标跑到了第二行,(第二行空行),请问怎么解决
[io.file]::WriteAllText(‘uuid.txt’,$uuid)
这样就没有空行
这样就没有空行