Powershell Tip #92: Rename the prefix of files using Insert method

By | March 1, 2016

Tip: You have a list of files with a specific prefix and you want to rename that.

For example, here you want to fix a wrong name WORSTATION to WORKSTATION.

Get-ChildItem-Workstation

Insert-method-string-powershell

Parameter 1 : the start index (the position)
Parameter 2 : the string to insert

String.Insert Method (Int32, String)
https://msdn.microsoft.com/en-us/library/system.string.insert(v=vs.110).aspx

Rename-Item-Bulk-Workstation


previous-buttonnext-button

2 thoughts on “Powershell Tip #92: Rename the prefix of files using Insert method

  1. Pingback: Powershell Tip #91: List optional and mandatory properties of the user class | Powershell Guru

  2. Pingback: Powershell Tip #93: Use the “2 in 1” cmdlet Tee-Object | Powershell Guru

Leave a Reply

Your email address will not be published. Required fields are marked *