vsinghscripts.psm1

cls

function get-maxlogfile
{
  Clear-Host

  $a=Get-ChildItem -Path c:\ -Filter *.log -Recurse | Select-Object Name,Length | Sort-Object -Property length -Descending | Select-Object -First 1

  Get-ChildItem -Path c:\ -Filter *.log -Recurse | Where-Object {$_.Length -eq $a.Length } | Select-Object Name,Length, directory
}


function get-systeminfo
{
[cmdletbinding()]
param()
  <#
      .SYNOPSIS
      Describe purpose of "get-systeminfo" in 1-2 sentences.
 
      .DESCRIPTION
      Add a more complete description of what the function does.
 
      .EXAMPLE
      get-systeminfo
      Describe what this call does
 
      .NOTES
      Place additional notes here.
 
      .LINK
      URLs to related sites
      The first link is opened by Get-Help -Online get-systeminfo
 
      .INPUTS
      List of input types that are accepted by this function.
 
      .OUTPUTS
      List of output types produced by this function.
  #>



  do
  {
    write-output -Message $text
    write-output -Message '****************************SYSTEM-INFORMATION***************************'
    write-output -Message ''
    write-output -Message 'Press 1 to See BIOS related information'
    write-output -Message 'Press 2 to See Operating System related information'
    write-output -Message 'Press 3 to See Computer System related information'
    write-output -Message 'Press 4 to see Network related information'
    write-output -Message ''
    write-output -Message $text
    write-output -Message ''
    $a=Read-Host -Prompt 'Enter Your Choice'
    Write-Debug "We have taken you choice"
    $c=Read-Host -Prompt 'Enter your ComputerName'
    Write-Debug "we took computer and trying to check the connectivity"
    Write-Debug "we are matching your condition and fetching the information"
    if($a -eq 1)
    {
      Get-WmiObject -Class win32_bios -ComputerName $c
    }
    elseif($a -eq 2)
    {
      Get-WmiObject -Class win32_operatingsystem -ComputerName $c
    }
    elseif($a -eq 3)
    {
      Get-WmiObject -Class win32_computersystem -ComputerName $c
    }
    elseif($a -eq 4)
    {
      Get-WmiObject -Class win32_networkadapter -ComputerName $c
    }
    else
    {
      write-output -Message 'Warning!!!!!! Please check you input it must be between 1 to 4'
    }
    $b=Read-Host -Prompt 'Do you wnat to continue (Y/N)'
  }
  until($b -eq 'N')
}

function get-backgroundcolor
{
[System.Console]::BackgroundColor
}

function get-beep
{
[System.Console]::Beep(1000,1000)
}