Editing XML file?
Hello, have a question about updating an XML doc. I have an unattend.xml file I’ve brought into powershell by: [xml]$Unattend = Get-Content \\share\unattend.xml I can view a value I want to change by:...
View ArticleReply To: Downloading Tables from webpages
Hmmm I have no idea which either of them mean so any information would be greatly appreciated. I did try to get it out as an XML however it didnt view correctly. I used the ConvertTo-XML cmdlet if...
View ArticleTo know what the programs does
Get-Process notepad | Where-Object { $time = (New-TimeSpan $_.StartTime (Get-Date)).TotalSeconds; ($time -lt 180) } | ForEach-Object { “Stop process $($_.id) after $time seconds…”; $_.Kill() } please...
View ArticleReply To: To know what the programs does
; doesn’t really do anything. It’s a command separator, but it’s unnecessary here. I don’t understand what you mean by “explain about the variable they assigned.” Maybe we can start with one question...
View ArticleReply To: Downloading Tables from webpages
No, ConvertTo-XML isn’t right, and once you parse as XML it won’t “display” at all. It’s an object hierarchy. If your HTML document is in $html, you’d do “[xml]$xml = $html” to attempt to parse the...
View ArticleReply To: Editing XML file?
Yeah, the XML object model is a bit difficult to work with. We did a chapter on this in “PowerShell In Depth,” do you happen to have a copy of that?
View ArticleReply To: Downloading Tables from webpages
Using the code above I have tried the code you suggested which in my code bove is: [xml]$xml = $doc and I get the following error: Cannot convert value “mshtml.HTMLDocumentClass” to type...
View ArticleReply To: Downloading Tables from webpages
That probably means it won’t work, and in terms of how you progress with writing the regex – unfortunately, as I said, I’m not the regex master . I’m personally not going to be much help to you. But...
View ArticleReply To: Downloading Tables from webpages
Ok thank you for your help. I am after trying to get the row which contains either Red or Yellow into a variable and then output the information in the cells of that row out so that it can be...
View ArticleReply To: Comparing values of two cells from different xls files
When you are automating Office applications, a good starting point is to see how the application does it. Office uses VBA ( Visual Basic for Applications ) to perform actions in the suite. So, start...
View ArticleReply To: Downloading Tables from webpages
I’ll take a stab at it. I generally approach this using a multi-line single-line regex, in a here-string (I call it “jumbo shrimp in a can”). Let me review the requirments and that data and see what I...
View ArticleReply To: Downloading Tables from webpages
First problem – there doesn’t appear to be any “Red” or “Yellow” in the sample data. Are we looking for background color, or foreground color?
View ArticleReply To: Any SCVMM 2012 folks here?
What kind of trouble, specifically? These kinds of settings are fairly trivial to configure with SCVMM.
View ArticleReply To: Downloading Tables from webpages
I believe I’ve accomplished what you are looking for with HTML DOM parsing, which is the first attempt in Powershell and my head hurts a little from beating it on my desk. However, this looks like a...
View ArticleQuestion for Don Jones about PowerShell book
Hi mate, Easier to do it here. This is the part that doesn’t make sense to me. In section 3.5.2 it says: What if you try to run a command and forget one of the mandatory parameters? Take a look at the...
View ArticleReply To: Any SCVMM 2012 folks here?
Right now the only way I’ve found to set the NIC config (IP address, subnet mask, DNS servers) is to use an unattend.xml answer file. I’m working on dynamically generating the unattend.xml with...
View ArticleReply To: Downloading Tables from webpages
Here’s a regex solution that works with the posted test data. There appears to be 2 color settings per entry, and none of them have values of Red or Yellow. I’m not sure which one is supposed to...
View ArticleReply To: Any SCVMM 2012 folks here?
There absolutely is. What you’re attempting to do is accomplished via VMM Service Templates. Here are a couple of resources that’ll get you started: A Tech Ed session I did in MSY this past June:...
View ArticleCreate HTML email report from csv file?
Hello, I am trying to create a report in HTML format to send to multiple people via email. The body of the email is in a csv file that is already created for me. I want to take a batch script that...
View ArticleReply To: Create HTML email report from csv file?
$html = Import-CSV whatever.csv | ConvertTo-HTML ? “Can’t get the format to work” doesn’t give me much to work with, but those two commands are where I’d start.
View Article