Search found 13003 matches

by jvierra
Tue Jan 15, 2019 3:00 pm
Forum: Windows PowerShell
Topic: Get-NetAdapterHardwareInfo
Replies: 1
Views: 60

Re: Get-NetAdapterHardwareInfo

$s = New-CimSession omega
Get-NetAdapterHardwareInfo -CimSession $s
by jvierra
Tue Jan 15, 2019 1:13 pm
Forum: PowerShell GUIs
Topic: Listbox - scroll insanely slow/choppy with mouse wheel but not scrollbar?
Replies: 4
Views: 77

Re: Listbox - scroll insanely slow/choppy with mouse wheel but not scrollbar?

Then your issue is not a scripting issue. It is a system issue and you need to check your mouse settings. The issue may also be a result of a high DPI monitor. If so then you will need to set the form up for high DPI use.
by jvierra
Tue Jan 15, 2019 12:36 pm
Forum: PowerShell GUIs
Topic: Listbox - scroll insanely slow/choppy with mouse wheel but not scrollbar?
Replies: 4
Views: 77

Re: Listbox - scroll insanely slow/choppy with mouse wheel but not scrollbar?

The scroll increment is set too high. The scroll on a ListBox can only be set by line - the scrollbar moves by pixel. The system and user preferences control this. Here are two files. Place them in a new temp folder and open the PSF and run it. It is a demo of how to use a ListBox and also scrolls s...
by jvierra
Mon Jan 14, 2019 9:07 am
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

The links can help you to acquire a consistent style that is generally acceptable across the industry and will help you to sort through much of the, at time, frustrating behavior of the PowerShell scripting system. It is not anything like any programming language. PowerShell is designed to solve man...
by jvierra
Fri Jan 11, 2019 4:15 pm
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

The following function is s utility function. It does not want to be made to look like a CmdLet. We don't need to add the parameter statements and we don't want it to be complicated. function Get-Index { param( [psobject[]]$Services ) Write-Host 'Returned services:' $Services | ForEach-Object{ Write...
by jvierra
Fri Jan 11, 2019 4:04 pm
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

The following kludge will get your output correctly: function Restart-JBService { [CmdletBinding(PositionalBinding = $true)] param ( [Parameter(Mandatory = $true, Position = 0)] [Alias('Name', 'Service')] [System.String] $ServiceName, [Parameter(Position = 1, HelpMessage = 'Which computer would you ...
by jvierra
Fri Jan 11, 2019 3:59 pm
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

Ok - now that I have fixed PSS, there is another issue that is common with design of scripts. The use or "Read-Host" in the pipeline will also cause all output to cease until the CmdLet is answered. This is a drawback to using Read-Hot in a pipeline. In modules and scripts files you either need to a...
by jvierra
Fri Jan 11, 2019 3:37 pm
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

One obvious mistake is the following: [System.Management.Automation.PSObject] $Services,[/b} $services can be an array. If you don't declare it as an array funny things will happen. The normal method would be: [object[]]$services or [array]$services or [psobject[]]$services The better design practic...
by jvierra
Fri Jan 11, 2019 3:28 pm
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

It may seem odd, however, I find it much easier to read and document than the alternative you posted with piping. I appreciate the help though, I'll see what I can do from here, thanks. That is because you are using and used to old V1 methods. It is also because you are not a Net programmer and do ...
by jvierra
Fri Jan 11, 2019 2:57 pm
Forum: Windows PowerShell
Topic: PowerShell writing to console out of order
Replies: 12
Views: 433

Re: PowerShell writing to console out of order

Thankyou fir fixing the post. Your code is quite odd. I recommend not using a bunch of one time functions and build this as a simple script that uses more standard coding for WMF 3 and later. This will help simplify your code. Also when trying to debug issues that you do not understand start by thro...