$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 и одновременно показать на экране а как имени файла указать кодировку? Если у меня могут быть как файлы на английском,так и на руссуом.
// set appropriate headers for attachment or streamed file
// The theoretically correct syntax for use of UTF-8 in Content-Disposition is very weird: filename*=UTF-8''foo%c3%a4 (yes, that's an asterisk, and no quotes except an empty single quote in the middle)
// This example is the same as the one above, but adding the "filename" parameter for compatibility with user agents not implementing RFC 5987:
// Content-Disposition: attachment;
// filename="EURO rates";
// filename*=utf-8''%e2%82%ac%20rates
// Note: Those user agents that do not support the RFC 5987 encoding ignore “filename*” when it occurs after “filename”.
// http://tools.ietf.org/html/rfc6266#section-5
//
header('Content-Disposition: attachment; filename="'.rawurlencode($file_name).'"; filename*=utf-8\'\''.rawurlencode($file_name));
get-help Block-SmbShareAccess -examples
Block-SmbShareAccess -Name VMFiles -AccountName Contoso\Guest
У вас же, судя по ошибке, в имени шары идёт полный путь, а не только имя. Имя у вас будет V$, откуда берётся \\FILESERVER\ вам виднее.PS> Get-Command -Module PrintManagement
Add-Printer
Add-PrinterDriver
Add-PrinterPort
Get-PrintConfiguration
Get-Printer
Get-PrinterDriver
Get-PrinterPort
Get-PrinterProperty
Get-PrintJob
Read-PrinterNfcTag
Remove-Printer
Remove-PrinterDriver
Remove-PrinterPort
Remove-PrintJob
Rename-Printer
Restart-PrintJob
Resume-PrintJob
Set-PrintConfiguration
Set-Printer
Set-PrinterProperty
Suspend-PrintJob
Write-PrinterNfcTag