forked from compwiz32/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path!Scratchpad.ps1
More file actions
26 lines (16 loc) · 764 Bytes
/
!Scratchpad.ps1
File metadata and controls
26 lines (16 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##Out-File longfilepath.txt ; cmd /c "dir /b /s /a" | ForEach-Object { if ($_.length -gt 250) {$_ | Out-File -append longfilepath.txt}}
cmd /c "dir /b /s /a" | ForEach-Object { if ($_.length -gt 250) {$_ | Write-Host $_.length, $_ }}
cmd /c "dir /b /s /a" | ForEach-Object Write-Host $_.length, $_ }
# $obj = New-Object psobject
Get-ChildItem C:\Scripts -Recurse | ForEach-Object {
$FilePath = $_.FullName
# $obj | Add-Member NotePropertyColumnA $FilePath.Length $obj | Add-Member NotePropertyColumnB $FilePath $obj
Write-Host $FilePath.Length, $FilePath
}
$array = @{}
Get-ChildItem C:\Scripts -Recurse | ForEach-Object {
$Path = $_.FullName
$PathLength = $a.Length
$array.Path = $Path
$array.PathLength = $PathLength
}