How to use -like for string in uppercase and lowercase


hello

i using following if else statement functionality same type of text i.e. cached. there way use 1 common statement?

if($oldfilename -like "*cached*")   	{  		$oldfilename=$oldfilename.replace('\cached','')                              	}  if ($oldfilename -like "*cached*")  	{  		$oldfilename=$oldfilename.replace('\cached','')  }

its regex need 2 "\\" replace one.

'\\cached\mydocuments\ak.txt' -replace '\\\\cached'


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group