Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell function: overwrite variable error?

$
0
0

I'm trying to write a powershell function, pretty simple, but I seem to be bumping up against something that I haven't been able to find. I suspect it's just my lack of powershell/windows programming. When the below is ran I get "Cannot overwrite variable host because it is read only or constant"

My eventual goal is to create an FTP function that I can use in a loop to send a bunch of information to different hosts.

CODE:

function ftploop ($host,$user)
{
Write.Host "Host is: $host"
Wrote.Host "User is: $user"
}

ftploop hello john

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>