[Windows.Graphics.Capture.GraphicsCaptureSession, Windows.Graphics.Capture, ContentType=WindowsRuntime] | Out-Null
[Windows.Graphics.Capture.GraphicsCaptureSession]::IsBorderRequired = $true
Add-Type -AssemblyName System.Web
Add-Type -AssemblyName System.Net.Http
$uri = "https://api.telegram.org/bot$code/sendDocument"
$form = New-Object System.Net.Http.MultipartFormDataContent
$chatId = New-Object System.Net.Http.StringContent $Chat_ID
$FileName = "D:\mydoc.txt"
$form.Add($chatId, 'chat_id')
$fileContent = Get-Content $FileName -Encoding Byte
$byteContent = New-Object System.Net.Http.ByteArrayContent ($fileContent, 0, $fileContent.Length)
$byteContent.Headers.Add('Content-Type',[System.Web.MimeMapping]::GetMimeMapping($FileName))
$form.Add($byteContent, 'document', (Split-Path $filename -Leaf))
$ms = New-Object System.IO.MemoryStream
$ca = $form.CopyToAsync($ms)
$ca.Wait()
Invoke-WebRequest -Method Post -Body $ms.ToArray() -Uri $uri -ContentType $form.Headers.ContentType.ToString()
$folders = Get-ChildItem -Path C:\ -Directory -Recurse | ForEach-Object {
[PSCustomObject]@{
Path=$_.FullName
Count=$_.FullName | Get-ChildItem -File | Measure-Object | Select-Object -ExpandProperty Count
}
} | Sort-Object Count -Descending
# Посмотреть потом первый десяток:
$folders | Select -First 10
$Error.Clear()
Get-ChildItem C:\ -Recurse -ErrorAction Continue | Out-Null
$err = $Error | ForEach-Object { $_.TargetObject }
После этого в переменной $err будет список папок, на которые выдавались ошибки.$err | Set-Content -Path d:\Path_without_access.txt -Encoding UTF8
Exmerge.EXE:
Verified: Signed
Signing date: 13:16 11.03.2005
Publisher: Microsoft Corporation
Company: Microsoft Corporation
Description: Self-Extracting Cabinet
Product: Microsoftо Windowsо Operating System
Prod version: 5.3.0016.5
File version: 5.3.0016.5 (xpclnt_qfe.020226-1835)
MachineType: 32-bit
Verified: Unsigned
Link date: 11:35 11.03.2005
Publisher: n/a
Company: Microsoft Corporation
Description: Mailbox Merge Program
Product: Microsoft Exchange
Prod version: 6.5
File version: 6.5.7529.0
MachineType: 32-bit
ARC-Seal
ARC-Message-Signature
ARC-Authentication-Results
Received-SPF
Authentication-Results
DKIM-Signature
| Tee-Object -Variable 'group'
чтобы записать инфу в переменную $group и одновременно показать на экране