Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Read folder name and use it text file

$
0
0

Hello, i need a little help here.
I am pretty new to powershell, can write some basic scripts but when comes to matching names of files and folders and after that uding them i am lost.
I need s script which will serach in mail folder for subfolder name and after that will user the subflder name to insert it in a text file.

I can gci the folder which i need like:

cd $clientfolder
$updatefolder = get-childitem  | Where { $_.PSisContainer -eq $True -and $_.Name -like "folder_2.0" }


So i will have a text file in clientfolder  folder.txt in which there will be a line which i need to update with the name of the folder - folder_2.0
The line looks like:
url = path + 'folder_2.0/';


So the idea is that the name of the folder will be different every time and i need to update the line in the file with the  current name of the folder.


Viewing all articles
Browse latest Browse all 6937

Trending Articles