trim string or select file
Posted: Fri Jan 29, 2016 12:50 pm
Sir, I have a FolderBrowserModernDialog which select a path to a file with a computer name. I need the path but I also need to get just the computer name ( which is the name of the folder selected). What property can retrieve the folder selected value/ Or would I have to do some kind of trim on the seleted path?
Where $textPath.Text = \\10.60.216.30\Backups$\cnu14171bg
I also want $selectedFolder.Text = cnu14171bg
Where $textPath.Text = \\10.60.216.30\Backups$\cnu14171bg
I also want $selectedFolder.Text = cnu14171bg
$btnBrowse_Click = { $folderbrowsermoderndialog1.SelectedPath = $textPath.Text if ($folderbrowsermoderndialog1.ShowDialog() -eq 'OK') { $txtPath.Text = $folderbrowsermoderndialog1.SelectedPath $selectedFolder.Text = $folderbrowsermoderndialog1. $global:oldComputerObject = Get-ADObject ($oldDistinguishedName) $organizationalUnit = Get-ADObject "OU=Agencies, DC=state, DC=in, DC=us" } }