commit 2b9925789181ee2f31c9d15de1e6bdd74cebeeae Author: Tim Susa Date: Fri Dec 20 14:24:42 2019 +0100 Push it to the limit diff --git a/README.md b/README.md new file mode 100644 index 0000000..53c74bc --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# KSW-Importer +A simple powershell script to create a valid xml file for exclusions in Kaspersky Server for Windows + +You can create an input file easily by using the windows build in dir command. Something like: +dir /s/b *.exe -> exclusionlist.txt + +How to use: + +Simply execute create_trusted_files.ps1 from powershell. You musst use parameters for input and output file. + +Example: ./create_trusted_files.ps1 -in exclusionlist.txt -out exclusions.xml + +The input file musst be a simple text file which contains one file to exclude per line. +The output file musste be a xml file. + +Works for KSC10 SP3! diff --git a/create_trusted_files.ps1 b/create_trusted_files.ps1 new file mode 100644 index 0000000..686fcb8 --- /dev/null +++ b/create_trusted_files.ps1 @@ -0,0 +1,63 @@ +Param( + [string]$in, + [string]$out +) + +$xml = @' + + + + WSEE + 8.0.0.0 + + + + <__VersionInfo> + 1 + 1 + + no + + + yes + +'@ +$xml | out-file $out -encoding utf8 +foreach($line in Get-Content $in) +{ $xml = " + <__VersionInfo> + 1 + 4 + + yes + yes + + + <__VersionInfo> + 1 + 0 + + 4 + $line + + + no + + + yes + yes + no + $line + yes + no + " + $xml | out-file $out -encoding utf8 -Append +} + +$xml = @' + + + + +'@ +$xml | out-file $out -encoding utf8 -Append diff --git a/create_trusted_folders.ps1 b/create_trusted_folders.ps1 new file mode 100644 index 0000000..ca0936f --- /dev/null +++ b/create_trusted_folders.ps1 @@ -0,0 +1,61 @@ +Param( + [string]$in, + [string]$out +) +$xml = @' + + + + WSEE + 8.0.0.0 + + + + <__VersionInfo> + 1 + 1 + + no + + + no + +'@ +$xml | out-file $out -encoding utf8 +foreach($line in Get-Content $in) +{ $xml = " + <__VersionInfo> + 1 + 4 + + yes + yes + + + <__VersionInfo> + 1 + 0 + + 3 + $line + + + no + + + yes + yes + no + $line + yes + no + " + $xml | out-file $out -encoding utf8 -Append +} +$xml = @' + + + + +'@ +$xml | out-file $out -encoding utf8 -Append