![]() It just uses a different method to read the text file.įoreach($subfolder in Get-Content "D:\Documents\newfolders. Like the script above, this PowerShell script reads the folder names from a text file. ![]() While (($subfolder =$addnewFolders.ReadLine()) -ne $null) Step 3: Select the location you want to save your personal folders. $addnewFolders= New-Object System.IO.StreamReader("D:\Documents\newfolders.txt") Step 1: Go to File, New, Outlook Data File Step 2: Select Office Outlook Personal Folders File (.pst), then click OK. To add the folders at the same level as the Inbox, change this line:ĭon't forget to change the path to the text file!Įnter your folder names in a text file, one name per line. Use this is you need to frequently create new folders as the text file is generally easier to update. This PowerShell script reads the folder names from a text file. ![]() # Repeat this line as needed, changing the folder name in each lineĬreate subfolders using a list of filenames $olApp = new-object -comobject outlook.application To add the folder at the same level as the Inbox, change this line:
0 Comments
Leave a Reply. |