您现在的位置是:网站首页> 编程资料编程资料
PowerShell小技巧之配置机器的静态IP_PowerShell_
2023-05-26
390人已围观
简介 PowerShell小技巧之配置机器的静态IP_PowerShell_
家用电脑安装了一台虚拟机,默认没有配置网络,本来是想利用PowerShell启用无线网络,可是安装过程需要在线获取一些文件,所以失败,无奈只能配置静态IP地址了,参考了Ed Wilson的:Use PowerShell to Configure Static IP and DNS Settings
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" $wmi.EnableStatic("192.168.1.15", "255.255.255.0") $wmi.SetGateways("192.168.1.1", 1) $wmi.SetDNSServerSearchOrder("8.8.8.8") 您可能感兴趣的文章:
相关内容
- PowerShell小技巧之启动远程桌面连接_PowerShell_
- Windows Powershell 创建数组_PowerShell_
- Windows Powershell 命令返回数组_PowerShell_
- Windows Powershell 变量的幕后管理_PowerShell_
- Windows Powershell 变量的类型和强类型_PowerShell_
- Windows Powershell 变量的作用域_PowerShell_
- Windows Powershell 环境变量_PowerShell_
- Windows Powershell 自动化变量_PowerShell_
- Windows Powershell 定义变量_PowerShell_
- Powershell小技巧之使用Get-ChildItem得到指定扩展名文件_PowerShell_
