I am trying to do this for a function that also collects inventory from systems. I’ve tried adding the code above but I am not doing something right as the function won’t run once I add this in. I did find another cool function in part of another script, if I could add that in it would be great. There are a few functions in the script that I’ve found would be good. There’s 1 that prompts what type of input you want to run the function against – a file, 1 name, search the domain, then 1 that prompts if you want to specify a different credential.
Can anyone help me figure out what to add to the function I want? The function is straight forward as it’s doing cmdlet binding
Here’s the start of the function I’m trying to use
[CmdletBinding()]
PARAM(
[Parameter(ValueFromPipeline=$true)]
[String[]]$ComputerName = $Computers,
[String]$Errors = “.\Failures.log”
)
BEGIN {}#PROCESS BEGIN
PROCESS{
FOREACH ($Computer in $ComputerName) {