Skip to main content
deleted 5 characters in body
Source Link
SimonS
  • 9.5k
  • 5
  • 31
  • 53
powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it.   

powershell -command "& 'C:\foobar.ps1'" 

You could also use powershell -file C:\file.ps1 to call a script

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it.  powershell -command "& 'C:\foobar.ps1'" You could also use powershell -file C:\file.ps1 to call a script

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File. when you're only using a command & is unnessecary, when you want to call a script, you should use it. 

powershell -command "& 'C:\foobar.ps1'" 

You could also use powershell -file C:\file.ps1 to call a script

added 67 characters in body
Source Link
SimonS
  • 9.5k
  • 5
  • 31
  • 53
powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it. powershell -command "& 'C:\foobar.ps1'" You could also use powershell -file C:\file.ps1 to call a script

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it. powershell -command "& 'C:\foobar.ps1'"

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it. powershell -command "& 'C:\foobar.ps1'" You could also use powershell -file C:\file.ps1 to call a script

edited body
Source Link
SimonS
  • 9.5k
  • 5
  • 31
  • 53
powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it formfrom CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

I removed the unneccessary stuff ->()

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it. powershell -command "& 'C:\foobar.ps1'"

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it form CMD

powershell -command " "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

I removed the unneccessary stuff ->()

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it. powershell -command "& 'C:\foobar.ps1'"

powershell -command "get-process | ? {$_.Description -eq 'Sysinter Process Explorer'} | select processname | out-file $env:APPDATA\example.txt"

basically you have a powershell command and paste it in between these quotes to call it from CMD

powershell -command " #PasteCodeHere "

inside these quotes you have to work with ' otherwise it will interrupt your command parameter.

Edit: Additional Information:

quite often you will encounter this: powershell -command "& 'somestuff'"

the & is used to call a File or a command. when you're only using a command & is unnessecary, when you want to call a script, you should use it. powershell -command "& 'C:\foobar.ps1'"

Source Link
SimonS
  • 9.5k
  • 5
  • 31
  • 53
Loading