Replace string in a list which start with Security and end ) – installed aplication


i have  exported list of installed application lot of computers. problem is, remove windows updates, etc in list..

list build :

server1, security…9), adobe…,7zip,app1,secur..7)

server2, security…2), adobe…,7zip,app1,secur..3),office

server2, adobe…,7zip,app1,secur..3),office,bdm

basically, can not replace  »security…..)«

if try $str = $str -replace 'security[^)]',',', get  output

server1, …9), adobe…,7zip,app1,..7)

i output similar server1, ,adobe…,7zip,app1)

$s='server1, security…9), adobe…,7zip,app1,secur..7)' -replace 'security\s\d\)',''
$s -replace 'secur\.+\d',''


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Round Robin is killing performance on our network

WMI Repository 4GB limit - Win 2003 Ent Question

Change home folder default permission?