Skip to content

REQ: Remove-Service cmdlet #4717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chucklu opened this issue Aug 31, 2017 · 12 comments
Closed

REQ: Remove-Service cmdlet #4717

chucklu opened this issue Aug 31, 2017 · 12 comments
Labels
Issue-Enhancement the issue is more of a feature request than a bug Resolution-Fixed The issue is fixed. Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module

Comments

@chucklu
Copy link
Contributor

chucklu commented Aug 31, 2017

Hi,
Since we have get-service,start-service,and some other functions about windows service.
Is it possible to add intall-service and uninstall-service?

I am using installutil.exe tool to do the installation and uninstallation.
sometimes, the uninstallation did not work.

installutil /u 

then I need to switch to cmd prompt,and use

 sc delete

If you can support install and uninstall service,it will be great.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
GitCommitId                    v6.0.0-beta.6
OS                             Microsoft Windows 10.0.10586
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@chucklu
Copy link
Contributor Author

chucklu commented Aug 31, 2017

By the way, when the installutil.exe /u did not work. It is something like this.

@iSazonov iSazonov added WG-Cmdlets general cmdlet issues Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module and removed WG-Cmdlets general cmdlet issues labels Aug 31, 2017
@chucklu
Copy link
Contributor Author

chucklu commented Sep 7, 2017

@chuanjiao10 thanks,new-service works.

@SteveL-MSFT SteveL-MSFT added the Resolution-Answered The question is answered. label Sep 7, 2017
@SteveL-MSFT
Copy link
Member

There isn't a Remove-Service. If needed, it would be an enhancement.

@chucklu
Copy link
Contributor Author

chucklu commented Sep 8, 2017

@SteveL-MSFT Would you add remove-service to an enhancement list?

@SteveL-MSFT SteveL-MSFT reopened this Sep 8, 2017
@SteveL-MSFT SteveL-MSFT added Issue-Enhancement the issue is more of a feature request than a bug Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors and removed Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif Resolution-Answered The question is answered. labels Sep 8, 2017
@SteveL-MSFT
Copy link
Member

@chucklu I've updated the title of this to reflect the ask, currently no plans to implement this

@chucklu
Copy link
Contributor Author

chucklu commented Sep 8, 2017

@SteveL-MSFT Thanks,I wish you guys can implement it in the future.

@SteveL-MSFT SteveL-MSFT changed the title Install-Service and Uninstall-Service not supported? REQ: Remove-Service cmdlet Sep 8, 2017
@SteveL-MSFT
Copy link
Member

@chucklu workaround for now:

get-ciminstance win32_service -filter "name='yourservicename'" | remove-ciminstance

@chucklu
Copy link
Contributor Author

chucklu commented Sep 9, 2017

@SteveL-MSFT thanks,I also find the command in powershell doc

PS C:\> sc.exe delete TestService
- or -
PS C:\> (Get-WmiObject win32_service -Filter "name='TestService'").delete()

It's not convenient, if you can support Remove-Service, it would be great.

@SteveL-MSFT
Copy link
Member

Get-WmiObject is deprecated and replaced by Get-CimInstance

@chucklu
Copy link
Contributor Author

chucklu commented Sep 9, 2017

thanks

@adityapatwardhan
Copy link
Member

Closed by #4858

@iSazonov iSazonov added the Resolution-Fixed The issue is fixed. label Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug Resolution-Fixed The issue is fixed. Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module
Projects
None yet
Development

No branches or pull requests

5 participants
@chucklu @SteveL-MSFT @adityapatwardhan @iSazonov and others