Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在powershell中合并对象_Powershell - Fatal编程技术网

在powershell中合并对象

在powershell中合并对象,powershell,Powershell,我正在尝试使用powershell创建一个基本的xor文件加密。 我的想法是这样的 [System.IO.File]::ReadAllBytes("test.txt") | foreach { [System.BitConverter]::ToInt32($_,0) -bxor [System.BitConverter]::ToInt32($password,0) } | Out-File "test.txt" 但我的问题是,字节一个接一个地抛出管道,这使得使用长度超过1个字符的密码毫无用处。

我正在尝试使用powershell创建一个基本的xor文件加密。 我的想法是这样的

[System.IO.File]::ReadAllBytes("test.txt") | foreach { [System.BitConverter]::ToInt32($_,0) -bxor [System.BitConverter]::ToInt32($password,0) } | Out-File "test.txt"
但我的问题是,字节一个接一个地抛出管道,这使得使用长度超过1个字符的密码毫无用处。 因此,我正在寻找一种组合元素的方法,以便元素以密码长度一样大的组进入for循环。 有人知道怎么做吗?

试过了

 get-content  -readcount 
是否将
-readcount
参数设置为密码长度