Using Powershell, I want to rename files in folders by using the name of the folder that the files are in. So in my C:\\temp directory, there are 3 folders called \'aaa\', \'bb
[IO.Directory]::GetCurrentDirectory().split('\\')[-1] will give you the directory you are in.
[IO.Directory]::GetCurrentDirectory().split('\\')[-1]