Group:  English: General ยป microsoft.public.windows.powershell

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Threads Replies Last Post
22 Pages: 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  
Find objects with a certain property
Hi, I found that the timespan object has a TotalMinutes property. Is there a way to find all the other objects that have the same property? Thanks for any help! ...
5 11.05.2007 13:55:36
Extra space with array
Hi, When I execute this script, I get an extra line per record. When I remove the teststring, I get one line per record. Can someone tell me how to leave in the teststring and have one record per line? thanks, $cmd="get-wmiobject -class win32_product -computername servername | select-object caption | findstr Office" $ar = invoke-expression $cmd foreach ($rec in $ar){ writ...
2 11.05.2007 02:19:50
Question about using .Net to change a Printer setting with Powersh
Hello, I have the following code that I'd like to use to alter settings about a printer via script: [System.Reflection.Assembly]::LoadWithPartialName("System.Printing") $printer = New-Object system.printing.printqueue("\\bl-dsa-print","TE299-HP2430-PCL6") $printer.set_Location("my new location") When I run that, I get the following exception: Exception calling "set_Location" with "...
7 10.05.2007 19:52:00
My Network Places in PowerShell
I'm trying to create a PowerShell script to move files in a folder on a My Network Place (located on our Server) to a subfolder on the same share. I'm not sure how to reference the My Network Place as a PSProvider. Any suggestions would be appreciated. Thanks!...
2 10.05.2007 19:03:00
Powershell and loading dependent assemblies
Is it possible to find out what exact (dependency) assembly Powershell had trouble finding? PS Z:\> $vaultServer.Login($loginCredentials) Exception calling "Login" with "1" argument(s): "Could not load file or assembly 'Symyx.Framework, Version=1.0.0.0, Cul ture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." At line:1 char:19 +...
3 10.05.2007 18:05:09
Bug in 32-bit PowerShell on Win2003 x64?
Almost every time I hit <Ctrl>+C from a 32-bit console running under Windows 2003 SP1 x64, the console will EXIT WITH PREJUDICE. I am NOT using <Ctrl>+<Break>. This is more than EXTREMELY annoying when debugging a script that must talk to a 32-bit COM object. How can I turn this behavior off!?! Jay ...
2 10.05.2007 17:24:28
Is there a (very small) length limit to write-host?
I have: #... some code ... write-host $string.Length write-host $string And it produces: 36418 Write-Host : The Win32 internal error "Not enough storage is available to process this command" 0x8 occurred when writing console output buffer at current cursor position. Please contact Microsoft Support Services. At C:\Get.ps1:52 char:11 + write-host <<<< $string...
3 10.05.2007 17:19:42
Newbie question: How can I perform web searches from PowerShell?
I have a dream. It's a strange dream, but there you go. I would like to be able to run a script, supply it search terms as parameters, and get the results back. I'm sure it's been done, but it is very difficult to search for. Can someone please post an example? (Note: I've seen the blog entries about searching Windows Desktop Search, and that's cool too, but I run Vista and it does...
17 10.05.2007 15:41:15
Convert Unix text files to PC text files
Has anyone got the code to convert unix text files (lines end with char(10)) to PC text files (lines end with char(10) and char(13)) ? Thanks in advance...
5 10.05.2007 15:39:01
New snapin for consuming .NET events in PowerShell
PSEventing 0.5 beta released Events in PowerShell - but how? Events in a .NET executable are generally raised and handled in realtime; at first glance, this doesn't seem possible with our favourite little shell. PowerShell lets us wire up scriptblocks to .NET events as handlers quite easily, but unfortunately when the event is raised, there is no runspace available to execute our script. S...
2 10.05.2007 13:10:05
Embarrassing limitation in PowerShell
XCOPY has been a joke forever because, even though it was the best built-in tool for copying files, it was stupidly limited in the folder depth or path length that it would support (and then it would just quit when a path was too long instead of even trying to proceed). So then we got ROBOCOPY instead of Microsoft just fixing XCOPY. So now PowerShell comes out, the new "shell for admini...
11 10.05.2007 12:54:43
Changing powershell prompt
I want to change my powershell prompt every time I start powershell. In short, I want to execute, function prompt {"Mugunth: $(get-date)>"} this script whenever I start powershell. Is this possible? If possible how is it done? ...
4 10.05.2007 12:15:34
Web Scraping
I want to grab a single web page and save it to disk using powershell. Can this be done in powershell?...
5 10.05.2007 12:11:48
WMI event - Failed to start event
Hello, I'm trying to subscribe to a WMI event on a remote server, with a different account. For the moment, i use the WaitForNextEvent() method of the ManagementEventWatcher class, and everything works fine. Now, i'd like to use the start() method instead. But i got an "acces denied" error (HRESULT : 0x80070005 (E_ACCESSDENIED)), which seems weird to me, since i'm able to catch the event ...
4 09.05.2007 23:48:00
Bug in COM wrapper for write-only properties?
I am scripting with the Perforce (Source Control) COM object, p4com from the following URL: http://public.perforce.com/guest/robert_cowham/perforce/API/p4com/main/index.html When PowerShell creates a wrapper for the object, it appears to do "the wrong thing" on a write-only property, and the property is not accessible. In this case, the "Input" property is defined as a write-only (prop...
2 09.05.2007 23:47:01
Http request problem
I'm having problems with a few sites when posting a http request using the following: $req = [System.Net.WebRequest]::Create($url) $req.ContentType = 'application/x-www-form-urlencoded' $req.Method = "POST" $bytes = [System.Text.Encoding]::ASCII.GetBytes($params) $reqstream = $req.GetRequestStream() $reqstream.Write($bytes, 0, $bytes.length) $reqstream.Close() $resp = $req.GetResponse()...
3 09.05.2007 20:23:23
$args in runspace invoke
if my script is "echo $args", but don't know before hand. Problem is, the script sees $input but not $args. Pipeline p = Runspace.DefaultRunspace.CreateNestedPipeline(script, false)) Collection<PSObject> results = p.Invoke(this.args); objects passed to Invoke are $input, not $args. So what to do to have $input processed into $args so things like Param() will work, etc. tia -...
1 09.05.2007 16:10:02
Writing a cmdlet: "Does not exist in the current context" error
I'm trying to create a cmdlet following this blog post: http://blog.sapien.com/current/2007/4/27/creating-a-balloon-tip-notification-in-powershell.html Here's my basic .cs: namespace MyBalloonTipSnapIn { [Cmdlet(VerbsCommon.New, "BalloonTip", SupportsShouldProcess = true)] public class BalloonTip : PSCmdlet { #region Parameters private string _title; [Parameter(Position = 0)] [Valid...
2 09.05.2007 15:49:05
exception when calling a method: object is read-only
Hello all, What does the error below mean? not sure what why this object would be read-only, or what that has to do with calling a method on it. PS Z:\> $vaultServer = new-object Symyx.Framework.Vault.VaultServer("localhost") PS Z:\> $vaultServer.Logout() Exception calling "Logout" with "0" argument(s): "Object is read-only." At line:1 char:20 + $vaultServer.Logout( <<&l...
3 09.05.2007 15:23:00
Logging off user
Just starting to play with PowerShell, so I thought I'd try to do something useful to get my feet wet. I have a Win XP computer that's not part of a domain and the "Switch User" is used occasionally, which leaves inactive users logged on. I'd like to schedule a job that can selectively logoff inactive users and not the potentially active current user. I found the Win32Shutdown method...
3 09.05.2007 14:17:35
Late Binding with IDispatch based com objects
Hi Is it possible to use late binding in powershell with com objects that implement only IDispatch and have no type library? In my tests powershell calls into my GetTypeInfo implementation, but after that it just errors out (GetIDOfNames is never called) : Property 'Name' cannot be found on this object; make sure it exists and is settable. At line:1 char:10 $Context.N <<<<...
2 09.05.2007 13:54:07
Loading Assemblies and Memory
In my scripts, I am using statements like [Reflection.Assembly]::LoadWithPartialName("System.Drawing") What happens to the assembly after my script exits? Is there a need to unload it? What happens when I run the same script repeatedly? I read somewhere that it's better to use: [Reflection.Assembly]::Load(("drawing", "System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyTo...
2 09.05.2007 07:54:00
Feedback Requested: New standard VERBS
I'd really appreciate feedback on this proposal to expand the standard verb set: http://blogs.msdn.com/powershell/archive/2007/05/09/proposed-new-standard-verbs.aspx Thanks! -- Jeffrey Snover [MSFT] Windows Management Partner Architect Microsoft Corporation This posting is provided "AS IS" with no warranties, no confers rights. Visit the Windows PowerShell Team blog at: http://blo...
1 09.05.2007 04:20:05
Looking for HTML parser
Hi, anyone know about an html parser that is doing: 1. load url to the parser 2. go throw the dom tree (parser.doc.body.div[6] or something) ...
2 09.05.2007 02:33:01
Cmdlet parmset and input question
Ok so I have a cmdlet that has two parmsets - one that takes file names and second that takes input from pipeline. cmd -Path <path> -pwd <string> cmd -Value <string> -pwd<string> Path can take value as a named parm, position or from pipeline. -Value can take value as named parm or from pipeline. So I don't have anything to disambiguate them (other then the Defa...
3 09.05.2007 01:33:43
22 Pages: 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net