我想用 powershell 腳本和這個 txt 檔案中的值更改 mtu
- 當我得到內容時,它給了我這個錯誤
- mtu 引數無效 (1492 )。

- 這段代碼有什么問題?
$GMTU = Get-Content C:\MTU2.txt
$AdapterName = $(Get-NetAdapter | Where { $_.Name -Match 'Ethernet'}).Name
netsh interface ipv4 set subinterface "$AdapterName" mtu=$GMTU store=persistent
uj5u.com熱心網友回復:
看起來最后一位數字后面有一個尾隨空格。您可以使用string.Trim()洗掉前導或尾隨空格:
$GMTU = (Get-Content C:\MTU2.txt -TotalCount 1).Trim()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/409804.html
標籤:
