window powershell 获取本机IP

简介: [System.Net.Dns]::GetHostAddresses(_.AddressFamily -eq 'InterNetwork'} |Select-Object -ExpandProperty IPAddressToString ...

[System.Net.Dns]::GetHostAddresses(ComputerName) | Where-Object {_.AddressFamily -eq 'InterNetwork'
} |
Select-Object -ExpandProperty IPAddressToString

目录
相关文章
【Azure App Service】PowerShell脚本批量添加IP地址到Web App允许访问IP列表中
Web App取消公网访问后,只允许特定IP能访问Web App。需要写一下段PowerShell脚本,批量添加IP到Web App的允许访问IP列表里!
182 2
|
12月前
|
网络安全 Windows
window powershell 查看ssh
window powershell 查看ssh
678 0
|
数据安全/隐私保护 异构计算 Windows
【Azure 环境】 介绍两种常规的方法来监视Window系统的CPU高时的进程信息: Performance Monitor 和 Powershell Get-Counter
【Azure 环境】 介绍两种常规的方法来监视Window系统的CPU高时的进程信息: Performance Monitor 和 Powershell Get-Counter
198 0
window powershell 删除文本的前几行
删除第一行 Get-Content a.txt | Select-Object -Skip 1 | Set-Content b.txt 复制代码 删除前2行 Get-Content a.
2229 1
window powershell 获取前后日期,格式化日期
today" 昨天 "昨天是:today.AddDays(-1))" 明天 "明天是:today.AddDays(1))" 一周前 "一周前是: today.
1769 2
window powershell 获取所有用户的最后登录时间
ComputerName) | Where-Object {adsi = [ADSI]"WinNT://adsi.Children | where {today=Get-Date -Format 'yyyyMMdd'ipaddr+""+ -replac...
1155 1
|
Windows
window powershell设置脚本的执行权限
Windows PowerShell 现用执行策略很可能是Restricted(默认设置)。 Restricted 执行策略不允许任何脚本运行。若要了解计算机上的现用执行策略,请键入:get-executionpolicy 。
2161 1
window powershell 替换文本的字符
(Get-Content file.txt) | Foreach-Object {$_ -replace '[MYID]','MyValue'} | Out-File file.txt
2066 0
|
Windows
Powershell 重新排列去重 Windows环境变量
【9月更文挑战第13天】本文介绍如何使用PowerShell对Windows环境变量进行重新排列和去重。首先通过`$env:`访问环境变量,接着使用`-split`命令分割路径,再利用`Select-Object -Unique`去除重复项。之后可根据需要对路径进行排序,最后将处理后的路径组合并更新环境变量。注意修改环境变量前应备份重要数据并了解潜在影响。
388 10