-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Beta.9 - Invoke-Item not accepting Credentials ends in error. #5416
Comments
FYI - It's happening in all versions of PowerShell
|
I will write up the issue in UserVoice for the Windows PowerShell. |
This is the documented behavior https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/invoke-item?view=powershell-5.1 From the
The |
Hum! You're eager to close this incident and provide a link (which I already have previously checked) without providing any room for a brief discussion. This is a vague note!
As, I'm trying to use the Invoke-Item cmdlet, to open either an app or a file which suppose to let use the credential parameter to accomplished my task. And, getting the same error:
Now, I've tried using this parameter to try open both an app ("notepad") and a file ("hosts") with user credentials (in this case as Admin). So, I'm guessing (because there was no discussion), that this is a documentation bug and this parameter should be removed from this cmdlet. Is this the case? Look, if I'm wrong in using this cmdlet, then fine! I just want to understand why not, as I think, I should be able to open a file using different credentials. :) |
@MaximoTrinidad I apologize if my response seems rushed or odd. However, this is the documented behavior of the You may want to read up on PSProviders: This includes a list of built in providers. One of which is the The built-in providers are not the only providers available. In fact, SHiPS was recently announced which makes it even easier to create custom PSProvders. And example PSProvder that is not built-in and is widely used is the There may be a need in a custom PSProvder for credentials to be supplied for various provider action concerning Items. In order to accommodate those PSProviders, the If your goal is to launch an application as another user you can use If you think the documentation should be made more clear, you may open an issue on PowerShell/PowerShell-Docs. While this Repository is open to general questions and support, its primary purpose is for reporting bugs, tracking work, and requesting features with PowerShell Core. When a documented behavior is presented as a problem the issue will be closed unless the suer is making a proposal to change the behavior. I don't believe changing the behavior in this instance is possible or desireable as there are other better means launch an application as another user. If you would like general help with PowerShell you can use Gitter, Slack, Reddit, and StackOverflow where people like myself hang out and help with any questions you might have. |
Awesome! Greatly Appreciate your response. Sorry for the rant! Yes! Last night I went and looked at another route using the Start-Process, and for my surprise, the credential parameter didn't work neither. I ended up using the "-Verb RunAs" parameter to accomplished what I needed. This time there were no notes like Invoke-Item. But, there's always a possibility that its a doc bug. Well, I appreciate your comments. Thank again, |
I'm building an scenario where I want to use "Invoke-Item" cmdlet with credentials but is not taking it Windows.
Although, I don't expect to use this in Linux, I did try it and gave me the same error message.
Steps to reproduce
Create the following credential object:
Try it in Linux (Ubuntu 16.04)
Expected behavior
It will open the application with the credential provided.
Actual behavior
Using PowerShell Core and Windows PowerShell in both OS's (Windows and Linux)
getting the following error messsage:
In Linux
Environment data
Windows 10 Insider Build 17035
Ubuntu 16.04.3
The text was updated successfully, but these errors were encountered: