The Notepad process was not terminating after the command execution
Line Added:
taskkill /im notepad.exe /t /f > NUL 2>&1
The /t option makes sure any child processes are closed as well, and the /f option forcefully terminates the process.
The > NUL redirects the stdout to the NUL device (the equivalent of /dev/null) and the 2 >&1 also redirects the stderr to stdout so that nothing is output to the console
* Created 3 copies of the original HKCU tests but on HKLM
Committer: Thomas De Brelaz <thockoro@hotmail.com>
* Removed Notify tests, no longer supported in win10 and the tests were broken due to missing dll prerequisite
* re-added notify test
Committer: Thomas De Brelaz <thockoro@hotmail.com>
Committer: Thomas De Brelaz <thockoro@hotmail.com>
Co-authored-by: Thomas De Brelaz <thomas.de-brelaz@ubisoft.com>
Co-authored-by: Carrie Roberts <clr2of8@gmail.com>
xcopy doesn't work when there is a trailing \ in a path.
default: PathToAtomicsFolder\T1505.003\src\ caused the "Invalid path" error
Removing the trailing \ fixes the issue
When using PowerShell remoting to Linux system where PowerShell <7.3 is installed, there is this quirk that right after connection is established, there must be nothing printed to stdout (no banner, nothing echoed in .bashrc). That's likely the reason for `-nologo` in sshd configuration [1] from my testing. Execution of the this test before this commit breaks SSH and even running cleanup command after initial test execution fails.
To prevent this test breaking SSH during described usage, default command was changed to print to file and not stdout.
Also replaced sed command in cleanup as it breaks when `command_to_add` is more complex command containing sed-specific special characters (e.g. `>`).
[1] https://learn.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core?view=powershell-7.2
Fix for systems with multiple authorized keys. Without quotes, the echo command separates new lines with space instead of new line character which breaks authorized_keys file in case there are multiple keys in the file.