Saturday, 31 August 2013

How to divide ASCII code in Powershell

How to divide ASCII code in Powershell

so in Powershell I want to take the ASCII code of a document and divide it
all by a Variable. Here is example code.
$file = Get-Content $home\example.txt -encoding byte
$value = 32984729847569237498
$file/$value | Set-Content $home\example.txt -encoding byte
Now the problem is that it says I cant divide it because there is no
op.Division. I can multiply it but the problem there is that it just takes
the contents of example.txt and copies it 32984729847569237498 times. What
I want it to do is divide the ASCII code by 32984729847569237498 so that
you can only get the original contents of the file back if you multiply it
by 32984729847569237498.

No comments:

Post a Comment