Skip to content
This repository has been archived by the owner. It is now read-only.

[BUG] clist -source webpi doesn't list commands (it flashes and disappears) #293

Closed
shanselman opened this issue May 28, 2013 · 13 comments

Comments

@shanselman
Copy link

commented May 28, 2013

clist -source webpi doesn't list commands (it flashes and disappears)

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

What version of PowerShell are you running? And have you installed the Web PI Commandline? (cinst webpicommandline).

The reason that I ask is that this worked for me:

clist_webpi

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

Looks like there is an issue though, in that this should be handled more gracefully, and not just disappear, but if we can trace the problem, we can work on a solution :-)

@shanselman

This comment has been minimized.

Copy link
Author

commented May 28, 2013

I have WebPi 4.0 and webPI command line via
cinst webpicommandline.7.1.1374.20120226. I have whatever PowerShell Win8
is, presumably 3.0.

On Tue, May 28, 2013 at 12:56 AM, Gary Ewan Park
notifications@github.comwrote:

Looks like there is an issue though, in that this should be handled more
gracefully, and not just disappear, but if we can trace the problem, we can
work on a solution :-)


Reply to this email directly or view it on GitHubhttps://github.com//issues/293#issuecomment-18536103
.

Scott Hanselman
Help me? http://hnsl.mn/fightdiabetes

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

Ah, my test was on a Windows 7 machine :-) Will do a test on a Windows 8 machine as well.

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

Hmmm...

Just tried again on my Windows 8 machine, and I get the same results as in the above screenshot.

What happens if you try running the following:

cmd.exe /c webpicmd /List /ListOption:All

This is what Chocolatey is doing under the hood for you.

Gary

@ferventcoder

This comment has been minimized.

Copy link
Contributor

commented May 28, 2013

Or try with -debug ?

On Tuesday, May 28, 2013, Gary Ewan Park wrote:

Hmmm...

Just tried again on my Windows 8 machine, and I get the same results as in
the above screenshot.

What happens if you try running the following:

cmd.exe /c webpicmd /List /ListOption:All

This is what Chocolatey is doing under the hood for you.

Gary


Reply to this email directly or view it on GitHubhttps://github.com//issues/293#issuecomment-18545703
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

Doh! That is the flag I was looking for! I was trying with -verbose, and that wasn't doing anything :-)

@mwrock

This comment has been minimized.

Copy link
Contributor

commented May 28, 2013

I just reproduced this. The key is to make sure you do not open your ps console as admin. I opened a standard ps console on win 8. UAC is enabled (as it will be on most win 8 installs since metro does not work without it) and I did not open as administrator. After invoking clist -source webpi, i was prompted to open a new PS session as admin which opened a new ps window where I saw the wonders of webpi flash before me and alas disappeared just as fast as they appeared. If I remember correctly, there is code that pumps the webpi output to a file and then the original session pulls that output from the file back into its own session. So something there is not quite right.

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

Ah, that makes sense :-)

I have a potential fix, namely:

  if ($source -like 'webpi') {
$chocoInstallLog = Join-Path $nugetChocolateyPath 'chocolateyWebPiInstall.log';
Remove-LastInstallLog $chocoInstallLog
$webpiArgs ="/c webpicmd /List /ListOption:All | Tee-Object -FilePath `'$chocoInstallLog`';"
Start-ChocolateyProcessAsAdmin "cmd.exe $webpiArgs" -nosleep
Create-InstallLogIfNotExists $chocoInstallLog
$installOutput = Get-Content $chocoInstallLog -Encoding Ascii
foreach ($line in $installOutput) {
  Write-Host $line
}

Which does the same thing as the Windows Feature equivalent, but it makes the command VERY slow to execute. Should I go ahead and make a PR to add this in? Or wait for another solution?

Gary

@mwrock

This comment has been minimized.

Copy link
Contributor

commented May 28, 2013

Unless someone has already checked, we should check if the latest webpi cli requires admin privileges to list packages and just remove the elevation if not. I'm also wondering if cinst is equally broken.

-----Original Message-----
From: "Gary Ewan Park" notifications@github.com
Sent: ‎5/‎28/‎2013 9:39 AM
To: "chocolatey/chocolatey" chocolatey@noreply.github.com
Cc: "Matt Wrock" matt@mattwrock.com
Subject: Re: [chocolatey] clist -source webpi doesn't list commands (itflashes and disappears) (#293)

Ah, that makes sense :-)
I have a potential fix, namely:
if ($source -like 'webpi') {
$chocoInstallLog = Join-Path $nugetChocolateyPath 'chocolateyWebPiInstall.log';
Remove-LastInstallLog $chocoInstallLog
$webpiArgs ="/c webpicmd /List /ListOption:All | Tee-Object -FilePath '$chocoInstallLog';"
Start-ChocolateyProcessAsAdmin "cmd.exe $webpiArgs" -nosleep
Create-InstallLogIfNotExists $chocoInstallLog
$installOutput = Get-Content $chocoInstallLog -Encoding Ascii
foreach ($line in $installOutput) {
Write-Host $line
}
Which does the same thing as the Windows Feature equivalent, but it makes the command VERY slow to execute. Should I go ahead and make a PR to add this in? Or wait for another solution?
Gary

Reply to this email directly or view it on GitHub.

@gep13

This comment has been minimized.

Copy link
Member

commented May 28, 2013

Just tried the latest webpi cli and looks like it requires admin privileges as well :-(

@ghost ghost assigned ferventcoder Jul 17, 2013
@ferventcoder

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2013

This seems simple enough to implement, we just ask for permission as we start it up... this is likely getting fixed in the next version

ferventcoder added a commit to ferventcoder/chocolatey that referenced this issue Nov 27, 2013
@ferventcoder

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2013

This should be completed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.