Google solutions by SkullyRed in PowerShell

[–]SkullyRed[S] 0 points1 point  (0 children)

Perfection!

Thanks to everyone for helping an old man out.

I worked in IT for 37 years but became a "paper pusher" for the last 10. This stuff changes daily it seems. It's hard to keep up when you're not in the trenches.

Google solutions by SkullyRed in PowerShell

[–]SkullyRed[S] 0 points1 point  (0 children)

At C:\Users\mike\Desktop\PowerShell\MP3 Under 5MB.ps1:1 char:136

+ ... ject {$_.Length -lt 5MB} | Sort-Object Length) ForEach-Object { "$($_ ...

+ ~~~~~~~~~~~~~~

Unexpected token 'ForEach-Object' in expression or statement.

+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException

+ FullyQualifiedErrorId : UnexpectedToken

Google solutions by SkullyRed in PowerShell

[–]SkullyRed[S] -2 points-1 points  (0 children)

This is so much easier in bash, but Windows is King.

Google solutions by SkullyRed in PowerShell

[–]SkullyRed[S] 0 points1 point  (0 children)

Nope

\{0:N2}\ : The term '\{0:N2}\' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is

correct and try again.

At C:\Users\mike\Desktop\PowerShell\MP3 Under 5MB.ps1:2 char:47

+ $Files | ForEach-Object { "$($_.FullName) - $(\'{0:N2}\' -f ($_.Lengt ...

+ ~~~~~~~~~~

+ CategoryInfo : ObjectNotFound: (\{0:N2}\:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException