$message = "Завершен процесс: $($process.Name) По причине\\Server01\process(idle)\% processor time$process = Get-Process someprocess
$process.PriorityClass = 'Idle' function Convert-HexStringToByteArray {
param (
[string]$hexString
)
$hexString = $hexString -replace ' ', ''
if ($hexString.Length % 2 -ne 0) {
throw "Invalid hex string length."
}
$byteArray = New-Object System.Collections.ArrayList
for ($i = 0; $i -lt $hexString.Length; $i += 2) {
[void]$byteArray.Add([Convert]::ToByte($hexString.Substring($i, 2), 16))
}
[byte[]]$byteArray
}[System.Collections.ArrayList]$searchBytes += , $searchHexPattern
[System.Collections.ArrayList]$replaceBytes += , $replaceHexPattern[void]$searchBytes.Add($searchHexPattern)
[void]$replaceBytes.Add($replaceHexPattern)[System.Collections.ArrayList]$handledPatterns = Separate-Patterns $patterns
[System.Collections.ArrayList]$searchBytes = $handledPatterns[0]
[System.Collections.ArrayList]$replaceBytes = $handledPatterns[1]$searchBytes, $replaceBytes = Separate-Patterns $patterns SearchAndReplace-HexPatternInBinaryFile как будто всегда возвращает массив, HandleFoundPatternsIndexes -patterns $patterns -foundPatternsIndexes $foundPatternsIndexesfunction test([int[]]$p) { write-host $p.getType() $p.Count $p }
test @()
System.Int32[] 0
test 1,2,4
System.Int32[] 3 1 2 4test $nullparam(
[string]$Patterns
)
$realPatterns = $Patterns -split ' '
...If lpApplicationName is NULL, the first white space–delimited token of the command line specifies the module name. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin
FilePath: >D:\test folder\with test file\myfile.exe<
Patterns: >11223344/55667788<
---
PS C:\Windows\system32> Тоже, думал в эту сторону. Но опций у ffmpeg не нашел таких.
ForEach-Object { $_.MainWindowTitle } | Where-Object { $_ -ne "" }; $windows.CountWhere-Object { $_.MainWindowTitle }; $windows.Count... -ErrorAction SilentlyContinue | Where-Object { $_.MainWindowTitle } | Measure-Object $_ -ne ""{ $_ } оставитьвот всякие манипуляции с датами и строками это гораздо удобнее