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

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file