From: me@somewhere.invalid   
      
   Robert Roland wrote:   
      
   >On Wed, 25 Oct 2023 14:00:42 +0100, Terry Pinnell   
   >   
   >>powershell.org   
   >   
   >In PowerShell, this should should work (not fully tested, all on one   
   >line):   
   >   
   >Get-ChildItem -Path "C:\FolderA" -Filter "*.mp3" | Sort-Object   
   >-Property Name | ForEach-Object -Process {Copy-Item -Path $_   
   >-Destination "C:\FolderB\"}   
      
   Thanks Robert. I've only occasionally used PowerShell, and then only in   
   copy/paste mode, so I expect I've not correctly edited your script:   
      
   Yours:   
   Get-ChildItem -Path "C:\FolderA" -Filter "*.mp3" | Sort-Object-Property   
   Name | ForEach-Object -Process {Copy-Item -Path $_-Destination   
   "C:\FolderB\"}   
      
   My paths are:   
   Source = "C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3 _files\FromL-1"   
   Destination = "L:\" (USB drive with an SD card holding my FAT-32 micro   
   SD card).   
      
   So this is what I tried:   
   Get-ChildItem -Path   
   "C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3 _files\FromL-1" |   
   Sort-Object-Property Name | ForEach-Object -Process {Copy-Item -Path   
   $_-Destination "L:\"}   
      
   This was the error message:   
      
    Get-ChildItem -Path   
   "C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3 _files\FromL-1" |   
   Sort-Object-Property Name | ForEach-Object -Process {Copy-Item -Path   
   $_-Destination "L:\"}   
   Sort-Object-Property : The term 'Sort-Object-Property' 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 line:1 char:143   
   + ... \TalkingTemp Proj\_MP3 _files\FromL-1" | Sort-Object-Property Name   
   | ...   
   + ~~~~~~~~~~~~~~~~~~~~   
    + CategoryInfo : ObjectNotFound:   
   (Sort-Object-Property:String) [], CommandNotFoundException   
    + FullyQualifiedErrorId : CommandNotFoundException   
      
   Terry   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|