Well, if you haven't heard, v2 CTP3 is out. Check it HERE.
This new release provides a feature where powershell.exe can be run with a hidden window/screen. This is definitely an FAQ candidate: I've seen this asked many times in various forums.
PS>powershell.exe /?
...
-WindowStyle
Sets the window style to Normal, Minimized, Maximized or Hidden.
...
(The CTP3 release notes have a typo: This parameter is covered as "-WindowsStyle".)
So if you run something simple like:
PS>powershell.exe -windowstyle hidden # from PowerShell
Be prepared... Not only will your current PowerShell console vanish, but you'll also have another PowerShell host running.
What do I mean, if you try the above, then open another PowerShell console, you could see:
PS> gps powershell
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
331 6 21396 7640 127 0.94 904 powershell
168 6 24384 33332 127 0.61 4752 powershell
210 6 25816 33936 129 0.53 5324 powershell
So, running with "hidden" hides the current process you just invoked, but also hides the console from which it was called/invoked in the first place.
This new hidden features is definitely useful for stuff like scheduled tasks where the solution before was to either wrap the PowerShell in VBScript or even use the Win32 APIs to do something more complicated.
Showing posts with label ctp. Show all posts
Showing posts with label ctp. Show all posts
Tuesday, December 23, 2008
Tuesday, June 17, 2008
MSDN LAB: Test v2 features (without installing)!
Thanks for /\/\o\/\/ for this information!
There's a new "MSDN Virtual Lab Express" out on PowerShell v2 features HERE.
Want to "test drive" v2 or need some guidance on what's new, and how to use it? There's a 20 page PDF that also comes when you sign up for the lab (even if you don't actually run or complete it, you can still download it).
There's a new "MSDN Virtual Lab Express" out on PowerShell v2 features HERE.
Want to "test drive" v2 or need some guidance on what's new, and how to use it? There's a 20 page PDF that also comes when you sign up for the lab (even if you don't actually run or complete it, you can still download it).
Saturday, June 14, 2008
BgShell – Background Shell
I think Lee Holmes started off something called "BgShell" HERE.
Since then, it has been added as a CodePlex project HERE.
Quote from the site:
"BGShell is a lightweight PowerShell 2.0 host written using Windows Forms."
Features:
* Tab expansion
* Syntax highlighting
* Visual Studio debugger-like tooltips
* Tabbed interface
The last 2 features listed above likely only work on Vista though.
Since then, it has been added as a CodePlex project HERE.
Quote from the site:
"BGShell is a lightweight PowerShell 2.0 host written using Windows Forms."
Features:
* Tab expansion
* Syntax highlighting
* Visual Studio debugger-like tooltips
* Tabbed interface
The last 2 features listed above likely only work on Vista though.
Friday, June 6, 2008
PowerShell v2 CTP/CTP2 error: "Error loading the extended type data file"
Over the last few months since the v2 CTP was released last November, from time to time, I've come across users getting this error when starting the v2 CTP/CTP2:
------------------------------------------------------------------------
Error loading the extended type data file:
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(257) :
Error in type "System.DirectoyServices.DirectoryEntry":
Exception: Cannot convert "Microsoft.PowerShell.AdapterCodeMethods" to "System.Type".
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(264) :
Error in type "System.DirectoyServices.DirectoryEntry":
Exception: Cannot convert "Microsoft.PowerShell.AdapterCodeMethods" to "System.Type".
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(275) :
Error in type "System.IO.DirectoryInfo":
Exception: Getter method should be public, non void, static, and have one parameter of type
PSObject.
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(306) :
Error in type "System.IO.FileInfo":
Exception: Getter method should be public, non void, static, and have one parameter of type
PSObject.
------------------------------------------------------------------------
What seems to have happened in most cases is that an attempt was made to uninstall PowerShell v1 manually.
I'm going to find some time hopefully before the end of the month to test this, but I believe the root cause is that when v1 is removed manually, DLLs in the .NET GAC (C:\Windows\Assembly) are left there.
It appears that the v2 CTP installer isn't set to overwrite these DLLs, so they remain as the older counterpart, and cause issues with v2 being able to load properly without any errors.
------------------------------------------------------------------------
Error loading the extended type data file:
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(257) :
Error in type "System.DirectoyServices.DirectoryEntry":
Exception: Cannot convert "Microsoft.PowerShell.AdapterCodeMethods" to "System.Type".
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(264) :
Error in type "System.DirectoyServices.DirectoryEntry":
Exception: Cannot convert "Microsoft.PowerShell.AdapterCodeMethods" to "System.Type".
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(275) :
Error in type "System.IO.DirectoryInfo":
Exception: Getter method should be public, non void, static, and have one parameter of type
PSObject.
Microsoft.PowerShell.Core,
C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(306) :
Error in type "System.IO.FileInfo":
Exception: Getter method should be public, non void, static, and have one parameter of type
PSObject.
------------------------------------------------------------------------
What seems to have happened in most cases is that an attempt was made to uninstall PowerShell v1 manually.
I'm going to find some time hopefully before the end of the month to test this, but I believe the root cause is that when v1 is removed manually, DLLs in the .NET GAC (C:\Windows\Assembly) are left there.
It appears that the v2 CTP installer isn't set to overwrite these DLLs, so they remain as the older counterpart, and cause issues with v2 being able to load properly without any errors.
Subscribe to:
Posts (Atom)