header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Search
Search Area
Criteria Options
Search Topics From
Search By User
Search in Forum(s)
Included Forums: ALL
Topic
RE: Cannot parse json
Get-Content returns an array. You need to do one of these: ConvertFrom-Json -Type PSObject -File .\data.json Or $data = gc .\data.json ConvertFrom-Json -TYpe PSObject "$data" Or $data = gc .\da ...
by Joel "Jaykul" Bennett in General PowerShell on 16 Oct 2011 07:26 PM
RE: Cannot parse json
I'm guessing you haven't tried mine ;) http://poshcode.org/2930 [code] PS> $images = ConvertFrom-JSON -Type PSObject @" { "images": [{ "imageName": "i20111006-00002-01_0001", "imagePath" ...
by Joel "Jaykul" Bennett in General PowerShell on 16 Oct 2011 10:20 AM
RE: newbie PS 3.0 issues
in Powershell_ISE clicking Update Help - errors, powershell.chm cannot be found Yeah, Update-Help requires: a) elevation, and b) help files. You should be able to update from the help files that came in the CTP CAB file (there were instructions in ...
by Joel "Jaykul" Bennett in General PowerShell on 15 Oct 2011 07:51 AM
RE: PoshCode Module does not load in V3
So, uhm, yeah. I fixed that in March ;-) But I never uploaded it, because the change comment would have violated NDA ;) I just uploaded it now, re-download.
by Joel "Jaykul" Bennett in General PowerShell on 15 Sep 2011 09:58 AM
RE: Color DataGridView
You need to handle the CellPainting event ... http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/1bf8dc22-0853-4cc5-a6c5-80da1707344c/ [code] $datagridView1.Add_CellPainting(({ param($source,$EventArgs) if( $EventArgs.Value ...
by Joel "Jaykul" Bennett in General PowerShell on 17 Aug 2011 07:21 AM
RE: Using DoEvents() in PowerShell
[System.Windows.Forms.Application]::DoEvents() But that doesn't force anything, it just allows the window to handle any events that have been raised. This would be easier in WPF, because you could bind the enabled state ... In WinForm ...
by Joel "Jaykul" Bennett in General PowerShell on 30 Jul 2011 06:55 AM
RE: databinding in ShowUI V1 dated June 6
That should be fixed in the next release, but in the meantime you can use the WPK syntax: TextBox -Name 'tb_Name' -DataBinding @{ Text = Binding -Path "Name" $data }Here's a working example: $data = Get-Command gcm; $data.Description = (get ...
by Joel "Jaykul" Bennett in General PowerShell on 08 Jun 2011 11:49 AM
RE: complete IE form
That's some scary markup -- I can't even figure out what it was supposed to look like. Try pasting it with "pre" tags around it in this forum. Or put it on a pastebin site ;) Normally I would say use an SGML parser like SgmlReader to get it, bu ...
by Joel "Jaykul" Bennett in General PowerShell on 21 Apr 2011 07:06 AM
RE: run script for 2 hours, then stop the script
Posted By Lisa on 28 Feb 2011 07:57 AM I would like to run this whole script for 2 hours total, then stop the script... Any ideas? Thanks! Yeah, I like RiffyRiot's timer idea.  I took the liberty to refactor a bit: function Star ...
by Joel "Jaykul" Bennett in General PowerShell on 09 Mar 2011 01:28 PM
RE: Execute command in csharp
Perhaps this can help you? http://huddledmasses.org/how-to-invoke-powershell-and-use-the-results-from-csharp/
by Joel "Jaykul" Bennett in Working with .NET on 03 Feb 2011 07:37 AM
RE: How to use this ftp modul?
Get-Credential returns a System.Net.ICredentials object, so you should be able to do something like ... $ftpCreds = Get-Credential Get-FtpList ftp://server/path $ftpCreds
by Joel "Jaykul" Bennett in General PowerShell on 04 Jan 2011 09:12 AM
RE: Make notepad visable on remote computer
The only way I can think of is to generate a scheduled task to start it.
by Joel "Jaykul" Bennett in General PowerShell on 26 Oct 2010 06:09 PM
RE: I have some part of code in .bat format trying to covert it into Powershell can some one help me.
Well, Select-String is like find, but 90% of the time you don't want to use that anymore: for instance, the first case is probably something like this: switch($Env:ComputerName) { 'ZZLB' { code here to handle the lab machine, can be multi ...
by Joel "Jaykul" Bennett in General PowerShell on 22 Oct 2010 09:31 AM
RE: How to Obtain current web page url, and Grab a string from Url.
I think your best bet is WatiN, http://sev17.com/tag/watin/  http://huddledmasses.org/tag/watin/ or the System.Windows.Automation classes (if all you need to do is get stuff from the URL). If you can wait until tomorrow, I'd have a better answer. G ...
by Joel "Jaykul" Bennett in General PowerShell on 18 Oct 2010 11:37 AM
RE: Task scheduler giving errors
It seems to me that if you're not able to create the remote session, it's most likely a permission issue. When you test run the script ... are you running it with the same command-line and credentials? That is, if you have a script "SchedulerT ...
by Joel "Jaykul" Bennett in Exchange Server on 08 Oct 2010 02:56 PM
RE: stuck in a kind of type conversion problem ...
This line: $name = $host_result -match "Name:" returns an array (a collection) of lines which have "Name:" in them ... unfortunately, powershell always stores things as "object" instead of stongly typed, so the output of the line is in fact a & ...
by Joel "Jaykul" Bennett in General PowerShell on 06 Oct 2010 06:05 AM
RE: Some ellipsis (...) characters
How are you outputting? I can't duplicate that :) I tried making myself similar output using the app below to no avail: add-type -Type @" using System; class OutputTest { static void Main(string[] args) { Consol ...
by Joel "Jaykul" Bennett in Using PowerShell v2.0 on 07 Sep 2010 08:54 AM
RE: How to Capture Form Close Event
Yeah! Just do the same thing: handle the event. I think you can use $this in the event handler, and you don't need to cast: $form = new-object system.windows.forms.form $form.Add_FormClosing( { $_.Cancel = $true; $this.Visible = $false } ) $fo ...
by Joel "Jaykul" Bennett in General PowerShell on 03 Sep 2010 05:49 AM
RE: Traverse multiple xml root node
The simplest thing is to take that content and wrap it into a single new root node so that you can parse it as XML. Let's assume you have a bunch of those nodes in text file incidents.logWe can use Select-Xml, but we need to wrap the xml so there's ...
by Joel "Jaykul" Bennett in General PowerShell on 30 Aug 2010 09:45 AM
RE: Traverse multiple xml root node
you need to mark that as code or something so the xml gets through
by Joel "Jaykul" Bennett in General PowerShell on 30 Aug 2010 08:50 AM
RE: Why is this appearing in my Add XML Element?
It's been awhile, but I believe the reason is that you're using CreateElement -- since it knows the document you're in has an xmlns (xml namespace), it adds it to the element when it creates it, because the element isn't (yet) in the document. The ...
by Joel "Jaykul" Bennett in General PowerShell on 17 Aug 2010 06:37 AM
RE: Powershell Versioning question
$Host.Version is the host version ... just like it says ;-) To get the POWERSHELL version you should look at $PSVersionTable -- but if it's not defined, then you're on PowerShell 1.0
by Joel "Jaykul" Bennett in General PowerShell on 12 Aug 2010 09:06 AM
RE: get-wmiobject win32_printer name includes twice as many "\"?
This is just a problem with PowerShell's interfacing to other query languages ;-) In PowerShell, the backtick is the escape character: ` But in WQL (WMI Query Language, which you're using in Get-WMIObject) and in regular expressions, and a few o ...
by Joel "Jaykul" Bennett in General PowerShell on 11 Aug 2010 06:55 AM
RE: read to the comma
The basics: $Date = get-date -format yyyy-mm-dd\.\t\x\t $Time = get-date -format T # Use Import-CSV to read in the CSV. If the csv doesn't have a header row, you should specify headers when you call import-csv: foreach($address in import-csv b ...
by Joel "Jaykul" Bennett in General PowerShell on 11 Aug 2010 06:20 AM
RE: How to change powershell configuration file at run time
First of all, you should dot-source your profile, not call it, so you need: . $Profile But it's a mistake to think that changing the profile and then executing it is the same as changing it and launching a new instance of PowerShell, because you ...
by Joel "Jaykul" Bennett in General PowerShell on 11 Aug 2010 06:04 AM
RE: Converting a txt file to a table
There's a ConvertFrom-PropertyString function on PoshCode http://poshcode.org/1956 which is designed to handle this stuff. It can handle parsing ini files, unix property files, and even simple not-nested yaml -- because they're all very similar. ...
by Joel "Jaykul" Bennett in General PowerShell on 04 Aug 2010 08:43 AM
RE: A count in a trap?
Posted By marco.shaw on 26 Jul 2010 04:48 AM $script:check may be more appropriate/less troublesome. I second that. If you must use global, make sure that at the top of your script (or in a begin { ... } block) you reset it to zero ;-)
by Joel "Jaykul" Bennett in General PowerShell on 26 Jul 2010 05:34 AM
RE: Controlling Exception Presentation
I'm not sure if there is a good reference, all I do is read the ones that Microsoft put in C:\Windows\System32\WindowsPowerShell\v1.0\ I didn't notice the [script removed] ... that's where the OPEN tag for ScriptBlock used to be.  You still ...
by Joel "Jaykul" Bennett in General PowerShell on 09 Jul 2010 12:32 PM
RE: Controlling Exception Presentation
Of course you can format things however you like. The output of errors, like everything else, is controlled by ps1xml format files.  The default format for ErrorRecord is in C:\Windows\System32\WindowsPowerShell\v1.0\PowerShellCore.format.ps1xml ... ...
by Joel "Jaykul" Bennett in General PowerShell on 09 Jul 2010 11:20 AM
RE: Adding Switches to Functions
Holy repetiveness batman! :) I think you should try generalizing things a bit: (REPOST) [CmdletBinding(DefaultParameterSetName="ByIndex")] ## you have to choose by index, because ANYTHING will cast to string. param( [Parameter( ...
by Joel "Jaykul" Bennett in General PowerShell on 24 Jun 2010 11:40 AM
Page 1 of 41234 > >>
Active Forums 4.3
right
footer   footer
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer   footer