3 ms·
"You have much less options when you are processing PowerShell objects." There is simply no need for the kind of extensive text processing common in Linux beca
by HyperSane 4y ago
"You have much less options when you are processing PowerShell objects."
There is simply no need for the kind of extensive text processing common in Linux because every command returns an object whose fields can be directly referenced. Combined with the ConvertTo-Json command this is incredibly powerful. Honestly it seems like you are attempting to do things in PowerShell the bash way instead of the PowerShell way.
" I think the first thing I tried to do in PowerShell was a script that scanned a directory recursively for files containing a CRC in their name, and then check it"
I wrote a PowerShell script that recursively scanned every filed and folder on our fileshares and wrote the permissions to a file for later indexing.
- ndsipa_pomu 4y agoI tried to write a PowerShell script to recursively scan and find files/folders older than a certain date, but kept hitting problems with the length of the path/filenames. As a complete PowerShell noob, I'm sure I was trying to do it the wrong way, but after a few attempts, I gave up and install cygwin instead.
- Macha 4y agoYour problem here is with win32 not powershell I suspect. Your script would probably have worked with powershell on Linux, but windows you need to use UNC paths to get a 2^16 - ~20 character path limit rather than the 256 character path limit of regular paths. Or there's some registry hacks to remove the limit from regular paths.
- ndsipa_pomu 4y agoYou're probably right. It was a few years ago and after trying a couple of alternatives, just went with what I know.
- HyperSane 4y agoYou can enable long path support in Windows to have paths up to 32,767 characters long https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry https://learn.microsoft.com/en-us/windows/win32/fileio/maxim...
- ndsipa_pomu 4y agoIt was a few years back, so probably before Windows included that ability (Windows 10 onwards?)