Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

POSH script or function how to add get-credentials?

$
0
0

Howdy All! 

How can I add something to function to get prompted for credentials?

Here's what I've started, the function works but I don't know where to put the credentials part. I did add in the .pscredential part.

[CmdletBinding()]

 PARAM(

  [Parameter(ValueFromPipeline=$true)]

  [String[]]$ComputerName = $Computers,

  [System.Management.Automation.PSCredential]$credential = get-credential)

  [String]$ErrorLog = ".\Errors.log"

    )

    BEGIN {}#PROCESS BEGIN

    PROCESS{

        FOREACH ($Computer in $ComputerName) {


Viewing all articles
Browse latest Browse all 6937

Latest Images

Trending Articles



Latest Images