Hi Guys
I have a simple script presented below now I want to add CLI menu for example:
By pressing 1 to 5 script will preform different assigned function
After selecting option are reciving results by pressing any button it will return to main menu
By pressing Q script will close menu and return to PS
I also want this to be saved as module so it can be imported on different maachine
What would be best solution to create such a menu
Regards
Raf
function Get-RemoteDeviceInfo
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$True)]
[string]$ComputerName
)
$computerSystem = get-wmiobject Win32_ComputerSystem -Computer $ComputerName
$computerBIOS = get-wmiobject Win32_BIOS -Computer $ComputerName
$computerOS = get-wmiobject Win32_OperatingSystem -Computer $ComputerName
$computerCPU = get-wmiobject Win32_Processor -Computer $ComputerName
$computerHDD = Get-WmiObject Win32_LogicalDisk -ComputerName $ComputerName -Filter "DeviceID='C:'"
write-host option displays detailed data
write-host "System Information for: " $computerSystem.Name -BackgroundColor DarkGreen
"-------------------------------------------------------"
" Manufacturer: " + $computerSystem.Manufacturer
" Model: " + $computerSystem.Model
" Serial Number: " + $computerBIOS.SerialNumber
" CPU: " + $computerCPU.Name
" HDD Capacity C: " + "{0:N2}" -f ($computerHDD.Size/1GB) + "GB" + " Free (" + "{0:N2}" -f ($computerHDD.FreeSpace/1GB) + "GB)"
" RAM: " + "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB) + "GB"
" Operating System: " + $computerOS.caption + ", Service Pack: " + $computerOS.ServicePackMajorVersion
" User logged In: " + $computerSystem.UserName
" Last Reboot: " + $computerOS.ConvertToDateTime($computerOS.LastBootUpTime)
}