Coder Social home page Coder Social logo

itps.omcs.tools's Issues

Ping the devices to ensure they are connected

Is your feature request related to a problem? Please describe.
After switching from Dell (Lexmark) to HP the "Status" doesn't change. Since the rest of the tests are "ping" tests make this one too.

Describe the solution you'd like
Find the port that is assigned to the printer (the actual print device) and ping it.

Describe alternatives you've considered
None

Additional context
None at this time.

Change the Test-FiberSatellite report to a CSV for later trending

Is your feature request related to a problem? Please describe.
Not really

Describe the solution you'd like
Make a CSV output file that can be used for trending.

Describe alternatives you've considered
Manipulating the log file with Python to get trending.

Additional context
Requesting for a friend

Here is the code for the CSV.

It just needs to be inserted into the original script

Same Parameters (mostly)

Added PingStat hashtable and ColumnNames for comparing the current file header, with what is in Sites.

$TimeStamp = Get-Date -Format G 
$Sites = @('localhost', 'www.google.com', 'www.bing.com', 'www.cnn.com', 'www.yahoo.com', 'random', '192.168.1.3')
$PingStat = [Ordered]@{
  'DateStamp' = $TimeStamp
}
$columns = @()
$PingReport = 'C:\temp\Reports\Ping.csv'
$PingReportInput = Import-Csv $PingReport
$ColumnNames = ($PingReportInput[0].psobject.Properties).name

Add any new sites to the report file

foreach($site in $Sites)
{
  Write-Verbose -Message "1. $site"
  if(! $ColumnNames.contains($site))
  {
    Write-Verbose -Message "2. $site"
    $PingReportInput | Add-Member -MemberType NoteProperty -Name $site -Value $null -Force
    $PingReportInput  | Export-Csv $PingReport -NoTypeInformation
  }
}

Ping the Sites

This is done as a job in this one. This script will run on it's own.

$job = Test-Connection -ComputerName $Sites -AsJob -Count 1 #-BufferSize 1024
if ($job.JobStateInfo.State -ne 'Running') 
{
  $Results = Receive-Job $job
}

Move the results to the hashtable

Builds the hashtable that will be used to populate the row. We could add each test to the file, but that would create a lot of white space. This builds that hash and then sends the hash to the file as a single row.

foreach ($Item in $Results)
{ 
  $Target = $Item.Address
  $TimeMS = $Item.ResponseTime
  $PingStat[$Target] = [string]$TimeMS
}

Export the hashtable to the file

Not much to say about this, but it could be a small function

$PingStat |
ForEach-Object -Process {
  [pscustomobject]$_
} |     
Export-Csv -Path $PingReport -NoTypeInformation -Force -Append

Get-InstalledSoftware - Update comment help

Is your feature request related to a problem? Please describe.

Get-Help Get-InstalledSoftware

It is not robust enough.
It doesn't have examples or a full description.

Describe the solution you'd like
Update the Comment Help

Compare-Folders did not work on a 2008 server.

Was attempting to use this yesterday on a 2008 server and it kept kicking out an error.

Since, I was able to access the same files through a share, I completed it there, and since the 2008 server is going away, I am not going to worry about this too much. I just want it documented.

'f_$OutputTable.Report' is not recognized

Describe the bug
The term 'f_$OutputTable.Report' is not recognized as the name of a cmdlet, function, script file, or operable program.

To Reproduce
Steps to reproduce the behavior:

  1. Run: Test-FiberSatellite
    8/2/2021 14:09:13 - erika tested 5 remote sites and 5 responded. The average response time: 33ms

The Ping-O-Matic Fiber Tester!
Round Trip Time is GOOD!
f_$OutputTable.Report : The term 'f_$OutputTable.Report' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At C:\Users\erika\Documents\WindowsPowerShell\Modules\ITPS.OMCS.Tools\1.11.1.7\Modules\Connectio
nsModule.psm1:416 char:9

  • '@ -f $(f_$OutputTable.Report), ('-' * 31), ('You can find the full r ...
  •     ~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (f_$OutputTable.Report:String) [], CommandNotFoun
      dException
    • FullyQualifiedErrorId : CommandNotFoundException

Expected behavior
No message

Requires Admin now

Describe the bug
Repair-WindowsUpdate sends all sorts of errors to the console, if you are not an admin.

To Reproduce
Steps to reproduce the behavior:

  1. Run Repair-WindowsUpdate as a normal user.

Expected behavior
Should give a "pretty" error message to warn the user they need admin rights

Additional context
Add any other context about the problem here.

Test-Replication RegEx does not work now.

Describe the bug
est-Replication : Cannot validate argument on parameter 'TestFile'. The argument "\folder-1\test.txt" does not match
the "
\\.txt
" pattern. Supply an argument that matches "
\\.txt
" and try the command again.
At line:1 char:60

  • ... cation -DfsrServers Server1, server2 -TestFile '\folder-1\test.txt'
  •                                                  ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Test-Replication], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Test-Replication

$time is a string and needs to be an [int]

Describe the bug
The math fails when $math*x

To Reproduce
Steps to reproduce the behavior:
Run the script with or without the $test param. It will error out as $time*2 not authorized.

Expected behavior
The script should "Sleep" for $time*x time based on whether the $test param is in place

Change the $time variable on lines 70 and 75 to:
[int]$time = 5
[int]$time = 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.