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

Convulated PS script to do various processes - variable assignments failing

$
0
0

Variables:

$strcomputer = "hfsat098123456"

I test the computer name for three different contents:
If $strcomputer -contains "hfsfs"
If $strcomputer -contains "hfsca" or "hfsat"
(or everything else)

Based on which one it returns, it copies specific files from specific directories.

I am testing with just the 1 computer above, for whatever reason in my script, it
always triggers a TRUE on the first IF (-contains "hfsfs") when is does not.
That is my primary problem.

 

Also, excuse my "all over the place script", and the duplication, I am still learning.

(Please visit the site to view this media)

 

 

 

 

 


Viewing all articles
Browse latest Browse all 8411

Latest Images

Trending Articles



Latest Images