Search found 14332 matches

by jvierra
Sun May 24, 2020 8:03 am
Forum: Windows PowerShell
Topic: Windows Service Validation Check to Inhibit Service Start
Replies: 1
Views: 155

Re: Windows Service Validation Check to Inhibit Service Start

Just make you checks in "Service-MyService" and don't set the bServiceRunning flag so the service will nver enter the run loop.
Why is that an issue?
by jvierra
Thu May 21, 2020 3:53 am
Forum: PowerShell GUIs
Topic: Custom Color for Tooltip on Menu Item
Replies: 5
Views: 301

Re: Custom Color for Tooltip on Menu Item

Yes. The drop down menu items for the toolstrip cannot be changed this way. Only the standard menu strip allows painting a background.
by jvierra
Wed May 20, 2020 3:09 pm
Forum: PowerShell GUIs
Topic: How to create a form and select a powershell script from a drop and run the script
Replies: 2
Views: 125

Re: How to create a form and select a powershell script from a drop and run the script

Hi - Sorry I missed this.
To do what you ask you would need to get the folders in question and store them in a drop down listbox. TO run the file you can use the "SelectedIndexChanged" event to obtain the value and run it.

The Info Center has examples of how to use ComboBoxes and ListBoxes.
by jvierra
Wed May 20, 2020 8:26 am
Forum: Windows PowerShell
Topic: XML Merge
Replies: 11
Views: 328

Re: XML Merge

Sorry but unless you can produce a real world example there is no way to know what to tell you to do. There is no way to generalize what you are asking. It can easily be done for those two files if we make a whole lot of limiting assumptions that would be true only for those exact files. Any changes...
by jvierra
Wed May 20, 2020 8:01 am
Forum: Windows PowerShell
Topic: XML Merge
Replies: 11
Views: 328

Re: XML Merge

Sorry but your files are not legal XML and cannot be loaded. Also what you are asking doesn't make much sense.

These are not real files - they are hand made examples. YOU need to post real XML and not just something you have tried to invent as an example.
by jvierra
Wed May 20, 2020 6:34 am
Forum: Windows PowerShell
Topic: XML Merge
Replies: 11
Views: 328

Re: XML Merge

It doesn't say what you want to compare or how you want to compare the hierarchy. To compare only the top level under "settings" you can just extract all nodes under the root and check if they match. $settings1 = $xml1.SelectNodes('//Settings') $settings2 = $xml2.SelectNodes('//Settings') Next I wou...
by jvierra
Wed May 20, 2020 5:47 am
Forum: Windows PowerShell
Topic: XML Merge
Replies: 11
Views: 328

Re: XML Merge

You are only getting one level which will never match and will not allow you any way to match. You must build your own code that compares what you need to compare and resolve what you mean by a match. XML is hierarchical and relational. Only the schema can tell you how to do what you want. You canno...
by jvierra
Tue May 19, 2020 11:03 pm
Forum: Windows PowerShell
Topic: XML Merge
Replies: 11
Views: 328

Re: XML Merge

Compare won't work with XML. XML is hierarchical and Compare-Object only works on flat objects. Node equivalence is not a simple string match. Also what i does merge mean in this case? Why use a function to call a function? It adds nothing and creates complexity that causes issues. To compare XML no...
by jvierra
Tue May 19, 2020 9:35 pm
Forum: Windows PowerShell
Topic: XML Merge
Replies: 11
Views: 328

Re: XML Merge

The simple answer is no. YOU cn load two XML files but you would have to defien what a "merge" means more fully. PowerShell has the "[XML]" type accelerator that will load a file but you would then have to walk through the structures one element at a time and decide what is to be copied and what is ...
by jvierra
Sat May 16, 2020 11:26 am
Forum: PowerShell GUIs
Topic: Custom Color for Tooltip on Menu Item
Replies: 5
Views: 301

Re: Custom Color for Tooltip on Menu Item

YOu can set OwnerDraw and use this to set the background: $tooltip1_Draw=[System.Windows.Forms.DrawToolTipEventHandler]{ #Event Argument: $_ = [System.Windows.Forms.DrawToolTipEventArgs] $r = [System.Drawing.RectangleF]::new($_.ClipRectangle.Location.X,$_.ClipRectangle.Location.Y,400,400) $_.Graphic...