Powershell Hex到Dec到IP地址 [英] Powershell Hex to Dec to IP Address

查看:122
本文介绍了Powershell Hex到Dec到IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部

我正在尝试将十六进制转换为十进制并同时创建一个IP地址。

I am trying to convert hex to dec and create a ip address at the same time.

*** *示例****

**** Example****

$ hex =" cf"," 6c"," 61"" 11"

$hex = "cf","6c","61","11"

foreach($ hex in $ hex)

foreach($value in $hex)

{[convert :: Toint32($ value,16)}

{ [convert::Toint32($value,16)}

207

108

97

17

我想做的是stich他们回到207.108.97.17。

What I'd like to do is stich them back as 207.108.97.17.

推荐答案

你可以使用-join:

You can use -join for this:


hex =" cf"," 6c" ;,"61","11"
hex = "cf","6c","61","11"


ip =(


这篇关于Powershell Hex到Dec到IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆