English 中文(简体)
视窗服务
原标题:Monitor Windows services with Cygwin
  • 时间:2012-04-25 13:30:45
  •  标签:
  • cygwin

我试图将我的一些例行壳体从PowerShell转向Cygwin,这多半是一次教育活动,但也因为我确实开始热爱一些六氯环己烷的器具。 我仍在设法确定如何列出/操纵Windows服务。 权力 壳牌拥有一些非常手提的工具,例如:

stop-service [pattern]
start-service [pattern]
gsv (or get-service) [pattern]

我最近与许多海关部门合作,并热爱不要转而让惠尔,在我的正常工作流程中这样做。 是否有任何人这样做? 在处理作为服务的Cygwin风暴时遇到许多 st,使一些试图回避这一问题的努力受到困扰。

最佳回答

Invoke Power Cygwin内部的壳体指挥:

cmd /c  %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe  -Command "gsv"

更一般性的解决办法是建立一个文字powershell.sh,其中包含:

#!/bin/bash
set -e
set -u
cmd /c  %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe  -Command "$@"

之后,可操作:/powershell.sh gsv。 或你需要的任何指挥。

问题回答

Invoke Power 在CMD.exe的Cygwin内部的壳牌。

With PowerShell 6.x Core s pwsh 指挥我们最终拥有权力,作为我们script、 rub、 p等的手法中的又一工具。

现有的权力形式可以用作不出现```'#!pwsh'问题的 she。 旧的Win7版本的PS2与监督事务司的专线挂钩,这样,你就不得不做一个包裹,在双向线上打上这种包装。





相关问题
cygwin file path tab completion not working

How can I set up Cygwin to have tab completion? Actually, I do have it automatically, but it does not seem to complete paths. How do I set it up to complete paths?

cygwin version of idle has erroneous I/O handling

I am using idle (python 2.5) via cygwin on a windows vista machine and when I try to open an already existing .py file I see the full file path /home/aaron/C:/cygwin/home/aaron/script.py on the ...

Trying to get a terminal to work in Emacs

I ve been having a lot of problems with emacs and trying to get the terminal to work with: M-x term I installed cygwin and I fixed up my .emacs to include the paths: (setenv "PATH" (concat "...

Piping Cygwin into a Python program

As a i m new to the whole Piping thing and Python I had recently encountered a problem trying to pipe Cygwin s stdin & stdout into a python program usin Python s subprocess moudle. for example I ...

Unable to chdir() on Git/Cygwin

I installed Git via Cygwin on Windows Server. It works out very well. However there s a small issue that when I clone a repo use the command as following: $git clone git@myserver:project.git I ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

Cygwin/Git/Gitosis unable to push new repository

I ve recently set up cygwin, git, and gitosis on my Windows Server 2003 box and am having troubles. I ve followed just about every tutorial I can find to the letter, and have confirmed that my git ...

热门标签