Spaces in nssm.exe command output in powershell

275 Views Asked by At

I'm using nssm.exe in my scripts to manage the windows services. But in PowerShell, the command output is coming with spaces after every alphabet.

PS> $nssm = (Get-Command D:\nssm.exe)
PS> & $nssm
nssm.exe : N S S M :   T h e   n o n - s u c k i n g   s e r v i c e   m a n a g e r 
At line:1 char:1
+ & $nssm
+ ~~~~~~~
    + CategoryInfo          : NotSpecified: (N S S M :   T h... m a n a g e r :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
 
 
 V e r s i o n   2 . 2 4   3 2 - b i t ,   2 0 1 4 - 0 8 - 3 1 
 
 
 U s a g e :   n s s m   < o p t i o n >   [ < a r g s >   . . . ] 
 
 
 
 
 
 T o   s h o w   s e r v i c e   i n s t a l l a t i o n   G U I : 
 
 
 
 
 
                 n s s m   i n s t a l l   [ < s e r v i c e n a m e > ] 
 
 
 
 
 
 T o   i n s t a l l   a   s e r v i c e   w i t h o u t   c o n f i r m a t i o n : 
 
 
 
 
 
                 n s s m   i n s t a l l   < s e r v i c e n a m e >   < a p p >   [ < a r g s >   . . . ] 
 
 
 
 
 
 T o   s h o w   s e r v i c e   e d i t i n g   G U I : 
 
 
 
 
 
                 n s s m   e d i t   < s e r v i c e n a m e > 

How to get the output without such wide-format spaces among alphabets?

0

There are 0 best solutions below