Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PowerShell doesn't execute command line and stalls?

$
0
0

Hi,

I am very very new to PowerShell and I have a problem using a command line that I found on the web. I actually used that command line a week ago to change similar parts of multiple file names. This is the command line:

Dir | Rename-Item -NewName {$_.name -replace "OLD-FILE-NAME-PART,"NEW-FILE-NAME-PART"}

On the screenshot, you can that I have some file names containing the word "Spud". I want to replace them quickly for "Bung" so I inputed:

Dir | Rename-Item -NewName {$_.name -replace "Spud,"Bung"}

But it doesn't work like the first I used it. Instead, I just skip a line and I am on a line only with "command begin" >> and I can hit Enter as much as I want or input another command but nothing happens (in the screenshot, I tried inputing dir, but nothing happens). I don't know if I'm stuck, or paused or whatever but when I hit ESC, the command line does back to the directory I was.

I'm using the arrows to move to the "OLD-FILE-NAME-PART,"NEW-FILE-NAME-PART" part of the command and change for Spud and Bung respectively if that helps. Thank's!

My command window looks like this (sorry no screenshot because my account is not verified?):

Directory: C:\Users\lf.baillargeon\OneDrive - Conception Génik Inc\temp\clé_Robot\13569_02\1


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a---l         11-10-19     7:03            1193 SR_Rb1VL18A_Seq_CycleSpud.JBI
-a---l         11-10-19     7:03            2024 TSK_Rb1VL18A_Prt02636A1.JBI
-a---l         11-10-19     7:03            1065 TSK_Rb1VL18A_PrtClr1ToSpud.JBI
-a---l         11-10-19     7:03             929 TSK_Rb1VL18A_SpudToPrtClr1.JBI
-a---l         11-10-19     7:03             992 TSK_Rb1VL18A_SpudToPrtClr1A.JBI


PS C:\Users\lf.baillargeon\OneDrive - Conception Génik Inc\temp\clé_Robot\13569_02\1> Dir | Rename-Item -NewName {$_.name -replace "Spud,"Bung"}
>>
>>
>>
>> dir
>>
>>
>>
>>                                                                                 >



Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>