Sure,
You could pattern match then rename each.
PS C:\Data\test> gci 'Microsoft.3DBuilder_*_neutral_~_8wekyb3d8bbwe'
Directory: C:\Data\test
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 4/18/2016 3:06 PM
Microsoft.3DBuilder_10.10.11.1_neutral_~_8wekyb3d8bbwe
d----- 4/18/2016 3:06 PM
Microsoft.3DBuilder_10.9.50.0_neutral_~_8wekyb3d8bbwe
So, continue with that, either accumulate the result set and loop over them, or
use a pipeline and perform the rename...
jlc
From: [email protected] [mailto:[email protected]] On
Behalf Of James Rankin
Sent: Monday, April 18, 2016 2:44 PM
To: [email protected]
Subject: [NTSysADM] Help with PowerShell
I come here once more with my PowerShell issues... :)
I want to rename a bunch of folders from a script (80+). They all have names
which can change slightly. For instance, one is
Microsoft.3DBuilder_10.9.50.0_neutral_~_8wekyb3d8bbwe
But this could change to, for instance
Microsoft.3DBuilder_10.10.11.1_neutral_~_8wekyb3d8bbwe
at any given moment.
Is there any way I could run a PowerShell command to rename a bunch of folders
but use a wildcard in the rename syntax (both for source and destination)? That
is
Microsoft.3DBuilder_*_neutral_~_8wekyb3d8bbwe would rename to
BLOCKED_Microsoft.3DBuilder_*_neutral_~_8wekyb3d8bbwe
Obviously the wildcard in the renamed folder could simply be the same pattern
as found in the original name.
Hope this is a little clearer than mud
James Rankin
EUC Director | HTG TaloSys | 07809 668579 |
[email protected]<mailto:[email protected]>
One Trinity Green, Eldon Street, South Shields, Tyne & Wear, NE33 1SA
Tel: 0191 481 3489
Email address: [email protected]<mailto:[email protected]>
Website: www.talosys.co.uk<http://www.talosys.co.uk>
[phpy9YoGNAM]