I can verify that some PowerShell script code that makes REST calls from the PowerShell ISE evades Fiddler (REST calls). Everything works from both a PowerShell console session and from the PowerShell ISE. It is just that when I invoke the commands from the PowerShell ISE, I see nothing in Fiddler.
Is there a specialized proxy setting for the PowerShell ISE that I don't know about?
PowerShell Info:
PowerShell v3/v4 on Windows 8.1
Fiddler Info:
Fiddler Web Debugger (v4.4.9.8)
Built: Thursday, December 18, 2014
64-bit AMD64, VM: 221.00mb, WS: 248.00mb
.NET 4.0.30319.0 WinNT 6.3.9600.0
Running ELEVATED on: :8888
Listening to: All Adapters
Gateway: No Gateway
Related
I am unable to run PowerShell Scripts on Server 2012 R2 Standard.
When I right-click on .ps1 file and run with powershell, nothing happens.. Powershell screen flashes away and exits.
Get-ExecutionPolicy always returns Unrestricted
Can you all guide me if any settings\IT policy requirement that needs to be checked.
An help would be highly appreciated on this.
I'm trying to emulate powershell version 2.0 in version 4.0
The following just freezes the application:
PS H:\> powershell.exe -version 2.0
I do get the following text but and the console continues to run and I am unable to execute further script.
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
As far as I'm aware, the command window in ISE is not a real console window. It's just pretending that it is. In reality, it's running the commands in the background and copying the output to the command window.
Note that when you try to run cmd.exe, you get this:
Cannot start "cmd". Interactive console applications are not supported.
To run the application, use the Start-Process cmdlet or use "Start PowerShell.exe" from the File menu.
To view/modify the list of blocked console applications, use $psUnsupportedConsoleApplications, or consult online help.
At line:0 char:0
Similarly, running powershell.exe alone gives me this:
Cannot start "powershell". Interactive console applications are not supported.
To run the application, use the Start-Process cmdlet or use "Start PowerShell.exe" from the File menu.
To view/modify the list of blocked console applications, use $psUnsupportedConsoleApplications, or consult online help.
At line:0 char:0
I'm not sure why powershell -version 2.0 works. The ISE must think you're calling it non-interactively.
Note that it's not freezing. It's waiting for the process to end. You can end it by pressing Ctrl+C.
Using Start-Process powershell.exe -ArgumentList "-Version 2.0" opens a new console window.
In my environment I have a single server that has access to pretty much my entire network. That server is running Windows 2008 r2, and I have upgraded Powershell to version 4.0. The question I have is this... Can I run cmdlets from that machine on other machines that are version 4 specific?
For instance, when I am using Powershell, even though it is version 4, it doesn't give me an intellisense autocomplete for "Get-Volume" like it would on a 2012 r2 machine. I understand that it won't run on that machine because the infrastructure won't allow for it, but what about a 2012 r2 machine remotely?
I am looking to run batch scripts from there for various purposes.
First, this is probably a ServerFault-question as it's related to server-administration.
PowerShell 4.0 installed on 2008 R2 can't run 2012 cmdlets on a 2012 R2-machine like Get-Volume -ComputerName My2012Server, because the cmdlets doesn't exist on your 2008 R2 machine. However, you should be able to invoke the cmdlet on the 2012 R2-server, like:
Invoke-Command -ComputerName My2012Server -Scriptblock { Get-Volume }
Be aware that you would not get autocomplete support when writing it as the commands and help files aren't installed on your 2008 R2-server
Import-PSSession is also a possibility if your gonna run the commands interactively. For a script I would probably still use Invoke-Command.
Get-Volume in your example is available only on Windows Server 2012 and above. So, it won't auto-complete on a 2008 R2 system. You can use PowerShell implict remoting.
Using implict remoting, you can import all cmdlets from a remote system into a local session and use them as if they are available on the local system.
I found a technet article to set the display resolution using powershell and Windows Server Core Cmdlets. http://technet.microsoft.com/en-us/library/jj603036.aspx
However when I try to run the cmd PS C:\> Set-DisplayResolution -Width 1920 -Height 1200 I get an error saying the Set-DisplayResoluton is a unknown cmd. I know this cmd is for administering server core functionlaity but can it be used in Windows 8.1. And if so, how do I load the cmdlet in Powershell?
Are you trying to run this on Windows 8.1? It looks like the command might only be available on Windows Server 2012 R2 Server Core. I understand that the article says otherwise, but I just checked on my Windows 8.1 computers, and do not have the command in the session.
Get-Command -Name *resolu*;
Running powershell v2 with exchange management console 2007 installed.
a powershell prompt shows the registered snapings:
PS P:\> get-pssnapin -registered | fl name
Name : Microsoft.Exchange.Management.PowerShell.Admin
Name : Microsoft.Exchange.Management.Powershell.Support
I can run exchange related commands from a powershell prompt, however, powershell studio 2012 doesnt seem to recognize the addin. In my _load method, I have
Add-PSSnapin Microsoft.Exchange.Management.Powershell.admin
But get this when I run the script:
ERROR: Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 2.
Powershell studio is the trial version and running v2 as well.
Maybe some snappins do not load with the trial?
You problem may come from the fact that PrimalScript 2012 and PowerShell Studio 2012 are 32 bit executables.
Have you got the two modes allowed in PowerShell Studio 2012 ?