Quantcast
Channel: AutoSPInstaller
Viewing all articles
Browse latest Browse all 2279

Commented Issue: Corner case bug in MatchComputerName function [21419]

$
0
0
On line 6894 of AutoSPInstallerFunctions.ps1 is the following line of code:

```
If ($computersList -like "*$computerName*") { Return $true; }
```

While this is a nice one-liner, it will not work correctly if one computer name is subset of another. For example, assume that there is an app server named Box1 and a WFE named Box11. In this case Box1 will match both of these and the app server will get the WFE bits installed (assuming server names are used).

Interestingly, the fix is to just delete this line. The following lines, 6895 - 6904, achieve the same goal without this potential bug.
Comments: ** Comment from web user: EricNelson72 **

The issue remains on line 7371

Unfortunately removing this line does not solve the problem given line 7380:

```
if ($computerName -match $item) {return $true;}
```

This will continue to fail as long as one server name is a subset of the other.


Viewing all articles
Browse latest Browse all 2279

Trending Articles



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