Use-Powershell

09 August 2023

List all hyper-v host in a scvmm cluster

›
 Get-SCVMHost -VMHostCluster ( Get-SCVMHostCluster -Name cluster_name) |  Select-Object Name
25 July 2023

Rescan disks remotely for a list of computers

›
 Get-Content .\records.txt | %{Invoke-Command -ComputerName $PSItem -ScriptBlock {@('RESCAN','EXIT') | diskpart}}
22 February 2023

Define powershell custom objects

›
 $hash = @{     Prop1      = 'Value1'      Prop2      = 'Value2'      Prop3      = 'Value3' } $CustomObject = [pscus...

Powershell generic List

›
list are allways to be used what the collection has to grow or shrink. arrays should be used only when the collection have a fixed length an...

Powershell - ignoring output performance

›
  (Measure-Command -Expression { [void]$(1..100000) }).Milliseconds 53 (Measure-Command -Expression { $null = $(1..100000) }).Milliseconds 4...
›
Home
View web version
Powered by Blogger.