Sunday, September 25, 2022

Powershell model with everything

 Powershell model with everything

Hello,

This model is to serve as reference for many powershell functions. Parameters, usefull functions, strings manipulation, psobject, xml, html.


TITLE OF A POWERSHELL SCRIPT

######################################################################

$title01 = "update all vm, get vm properties (vmware and hyperv)"

######################################################################

cls


PARAMETERS

################################################

# parameters

################################################

$params01 = New-Object PsObject

$params01 | Add-Member NoteProperty -Name domain_computers_scan -value 0        # scan all computers in the domain

$params01 | Add-Member NoteProperty -Name domain_computers_scan1pc -value ""        # scan one computer in the domain (if empty, scan all enabled win10 win11)


REQUIREMENTS

#############################################
# requis
#############################################
# windows 7
#   Set-ExecutionPolicy RemoteSigned
# windows 10
#   Set-ExecutionPolicy -scope currentuser RemoteSigned
# when module is there but wont load command
#   Set-ExecutionPolicy -scope currentuser unrestricted