…
High
11
u/DevinSysAdmin
In light of all the rant threads we see, what success have you had this week?
New job? Automated something? Project Complete? Cool new hardware?
Hoping r/PowerShell saves the day for me.
Need help with a powershell script that:
Asks for the MMDDYYYY input.
Asks for a number.
Keeps the first 4 numbers of the existing file name
Uses . inbetween each input
Example file names:
1234JimBob20230802092010677.pdf
4873JoeFree20230802092010677.pdf
8973BobKing20230802092010677.pdf
Example Renamed Files Output:
1234.05252023.53
4873.05252023.53
8973.05252023.53
Here is what i have so far:
$Date = Read-Host "Please write date in MMDDYYYY format. EX: 06252023"
$CheckNumber = Read-Host "Please write check sequence number. EX: 50"
Get-ChildItem | %{Rename-Item $_ -NewName "$($_.Name.Substrin