QuickFix.psm1
|
# Variables Set-Variable -Name "Date" -Value (Get-Date) -Scope global -Description "Specifies date and time" -PassThru | Format-List -Property * Set-Variable -Name "Domain" -Value "domain.net" -Scope global -Description "Specifies domain name as Secure-String" Set-Variable -Name "ComputerName" -Value ($env:COMPUTERNAME) -Scope global -Description "Specifies computer name" Set-Variable -Name "User" -Value ($env:USERNAME) -Scope global -Description "Specifies user name" Set-Variable -Name "wifiInt" -Value (Get-NetAdapter | Where-Object { $_.Name -match 'WiFi' }) -Scope global -Description "Specifies WiFi interface" Set-Variable -Name "ethInt" -Value (Get-NetAdapter | Where-Object { $_.Name -match 'Ethernet' }) -Scope global -Description "Specifies Ethernenet interface" Set-Variable -Name "NetAdapter" -Value (Get-NetIPConfiguration -Detailed | Select-Object InterfaceAlias, @{Name="DHCP";Expression={$_.NetIPv4Interface.DHCP}}) -Scope global -Description "Specifies network adapters" Set-Variable -Name "SerialNumber" -Value (Get-CimInstance Win32_BIOS | Select-Object -ExpandProperty SerialNumber) -Scope global -Description "Specifies serial number" Set-Variable -Name "DNS" -Value (Get-DnsClientServerAddress -AddressFamily IPv4 | Select-Object ServerAddresses) -Scope global -Description "Specifies DNS addresses" Set-Variable -Name "DNS1" -Value '9.9.9.11' -Scope global -Description "Specifies DNS server address as Secure-String" Set-Variable -Name "DNS2" -Value '142.112.112.11' -Scope global -Description "Specifies DNS server address as Secure-String" Set-Variable -Name "uptime" -Value (Get-CimInstance Win32_OperatingSystem | Select-Object LastBootUpTime, @{Name="Uptime"; Expression={(Get-Date) - $_.LastBootUpTime}}) -Scope global -Description "Specifies uptime" Set-Variable -Name "drivers" -Value (Get-WindowsDriver -Online -All | Select-Object 'Driver', 'Date', 'Version') -Scope global -Description "Specifies windows drivers" Set-Variable -Name "LastPoint" -Value (Get-ComputerRestorePoint -LastStatus) -Scope global -Description "Specifies last restore point" Set-Variable -Name "pro" -Value (Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty Name) -Scope global -Description "Specifies processor usage" Set-Variable -Name "mem" -Value (Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -ExpandProperty FreePhysicalMemory | ForEach-Object { $_ / 1MB }) -Scope global -Description "Specifies memory usage" Set-Variable -Name "description" -Value (Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Description) -Scope global -Description "Specifies machine description" Set-Variable -Name "tag" -Value (Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -ExpandProperty SMBIOSAssetTag) -Scope global -Description "Specifies machine asset tag" Set-Variable -Name "DiskSpace" -Value (Get-CimInstance -Class Win32_logicalDisk | Where-Object {$_.DeviceID -eq 'C:'} | Select-Object Size, FreeSpace) -Scope global -Description "Specifies disk space" Set-Variable -Name "FreeSpace" -Value ($DiskSpace.FreeSpace / $DiskSpace.Size * 100) -Scope global -Description "Specifies free disk space" Set-Variable -Name "temp" -Value (Get-CimInstance -Namespace root\wmi -Class MSAcpi_ThermalZoneTemperature -ComputerName $computerName | Select-Object -ExpandProperty CurrentTemperature) -Scope global -Description "Specifies machine temperature" Set-Variable -Name "lock" -Value (Get-BitLockerVolume -MountPoint "C:" | Select-Object volumetype, protectionstatus -Verbose) -Scope global -Description "Specifies Bitlocker state" Set-Variable -Name "AV" -Value (Get-MpComputerStatus | Select-Object 'AMServiceEnabled', 'AntispywareEnabled', 'AntivirusEnabled') -Scope global -Description "Specifies antimalware software (Defender)" Set-Variable -Name "acls" -Value (Get-Acl -Path C:\ | Select-Object 'AccessToString') -Scope global -Description "Specifies access control lists" Set-Variable -Name "secboot" -Value (Confirm-SecureBootUefi) -Scope global -Description "Specifies secure boot" Set-Variable -Name "DefaultGateway" -Value ((Get-NetRoute | Where-Object {$_.DestinationPrefix -eq '0.0.0.0/0' -and $_.NextHop -ne '::'}).NextHop) -Scope global -Description "Specifies default gateway" Set-Variable -Name "Ping" -Value (Test-Connection $DefaultGateway -Count 1) -Scope global -Description "Specifies ping testing gateway" Set-Variable -Name "battery" -Value (Get-CimInstance -ClassName CIM_Battery | Select-Object 'Status') -Scope global -Description "Specifies battery status" Set-Variable -Name "GetIP" -Value ((Get-NetIPConfiguration) | Select-Object IPv4DefaultGateway) -Scope global -Description "Specifies IP address" Set-Variable -Name "NextHop" -Value (($GetIP.IPv4DefaultGateway)) -Scope global -Description "Specifies next-hop address" Set-Variable -Name "socket" -Value ((new-object System.Net.Sockets.TcpClient($NextHop.NextHop, $port))) -Scope global -Description "Specifies ..." Set-Variable -Name "LogDate" -Value ((get-date) - (New-TimeSpan -Day 1)) -Scope global -Description "Specifies system logs" Set-Variable -Name "powerEventIDs" -Value (@(12, 41)) -Scope global -Description "Specifies power log events" Set-Variable -Name "logs" -Value (get-winevent | Where-Object {$_.LevelDisplayName -eq $LogDate, 'Critical, Warning', $powerEventIDs} | Select-Object -ExpandProperty Message) -Scope global -Description "Specifies specific logs" Set-Variable -Name "Get-Ports" -Value (get-nettcpconnection | Select-Object LocalPort) -Scope global -Description "Specifies local ports" Set-Variable -Name "Ports" -Value (($GetPorts.LocalPort)) -Scope global -Description "Specifies local ports" Set-Variable -Name "emailAddress" -Value "helpdesk.net" -Scope global -Description "Specifies email address for SMTP alert" Set-Variable -Name "deliveryProblems" -Value (Get-DeliveryProblems -EmailAddress $emailAddress) -Scope global -Description "Specifies delivery problems with SMTP alert" # Modules Export-ModuleMeber -Function ClearCache |