Cannot run Maven using `mvn -D` argument within Microsoft Powershell, but works in Command Prompt

When you run into problems with PowerShell’s interpretation of arguments to be passed to a console EXE, try using the echoargs.exe utility that comes with the PowerShell Community Extensions. With this tool you can see how PowerShell supplies the arguments to the EXE e.g.: PS> echoargs mvn clean install -Dmaven.test.skip=true Arg 0 is <mvn> Arg … Read more

MVVM Routed and Relay Command

RoutedCommand is part of WPF, while RelayCommand was created by a WPF Disciple, Josh Smith ;). Seriously, though, RS Conley described some of the differences. The key difference is that RoutedCommand is an ICommand implementation that uses a RoutedEvent to route through the tree until a CommandBinding for the command is found, while RelayCommand does … Read more

How to get Command Line info for a process in PowerShell or C#

In PowerShell you can get the command line of a process via WMI: $process = “notepad.exe” Get-WmiObject Win32_Process -Filter “name=”$process”” | Select-Object CommandLine Note that you need admin privileges to be able to access that information about processes running in the context of another user. As a normal user it’s only visible to you for … Read more

How to insert a new element under another with xmlstarlet?

I had a similar problem: I had a Tomcat configuration file (server.xml), and had to insert a <Resource> tag with pre-defined attributes into the <GlobalNamingResources> section. Here is how it looked before: <GlobalNamingResources> <!– Editable user database that can also be used by UserDatabaseRealm to authenticate users –> <Resource name=”UserDatabase” auth=”Container” type=”org.apache.catalina.UserDatabase” description=”User database that … Read more