Repository: microsoft/CSS-Exchange
File: Shared/IISFunctions/Get-IISModules.ps1 (PowerShell)

Code before:
            "$env:windir\system32\inetSrv\authBas.dll",
            "$env:windir\system32\inetSrv\authsspi.dll",
            "$env:windir\system32\inetSrv\authMd5.dll",
            "$env:windir\system32\inetSrv\modRqFlt.dll",
            "$env:windir\system32\inetSrv\filter.dll",
            "$env:windir\system32\rpcProxy\rpcProxy.dll",
            "$env:windir\system32\inetSrv\validCfg.dll",
            "$env:windir\system32\wsmSvc.dll",
            "$env:windir\system32\inetSrv\ipReStr.dll",
            "$env:windir\system32\inetSrv\dipReStr.dll",
            "$env:windir\system32\inetSrv\iis_ssi.dll",
            "$env:windir\system32\inetSrv\cgi.dll",
            "$env:windir\system32\inetSrv\iisFcGi.dll",
            "$env:windir\system32\inetSrv\iisWSock.dll",
            "$env:windir\system32\inetSrv\warmup.dll")

        function GetModulePath {
            [CmdletBinding()]
            [OutputType([System.String])]
            param(
                [string]$Path
            )

            if (-not([String]::IsNullOrEmpty($Path))) {
                $returnPath = $Path

                if ($Path -match "\%.+\%") {
                    Write-Verbose "Environment variable found in path: $Path"
                    # Assuming that we have the env var always at the beginning of the string and no other vars within the string
                    # Example: %windir%\system32\SomeExample.dll
                    $preparedPath = ($Path.Split("%", [System.StringSplitOptions]::RemoveEmptyEntries))
                    if ($preparedPath.Count -eq 2) {
                        if ($preparedPath[0] -notmatch "\\.+\\") {
                            $varPath = [System.Environment]::GetEnvironmentVariable($preparedPath[0])
                            $returnPath = [String]::Join("", $varPath, $($preparedPath[1]))
                        }
                    }
                }
            } else {
                $returnPath = $null
            }

            return $returnPath
        }
        function GetIISModulesSignatureStatus {
            [CmdletBinding()]
            param(
                [Parameter(Mandatory = $true)]
                [string]$ComputerName,

                [Parameter(Mandatory = $true)]

Review comment (bug):
Because this is how it was before, we can let this slide, but this is wrong to do it this way. We are doing `$env:windir` of the execute server vs the remote server. 

Code after:
                }
            } else {
                $returnPath = $null
            }

            return $returnPath
        }
        function GetIISModulesSignatureStatus {
            [CmdletBinding()]
            param(
                [Parameter(Mandatory = $true)]
                [string]$ComputerName,

                [Parameter(Mandatory = $true)]
                [object[]]$Modules,

                [Parameter(Mandatory = $false)]
                [bool]$SkipLegacyOSModules = $false,

                [Parameter(Mandatory = $false)]
                [ScriptBlock]$CatchActionFunction
            )
            begin {
                # Add all modules here which should be skipped on legacy OS (pre-Windows Server 2016)
                $modulesToSkip = @(
                    "$env:windir\system32\inetSrv\cachUri.dll",
                    "$env:windir\system32\inetSrv\cachFile.dll",
                    "$env:windir\system32\inetSrv\cachtokn.dll",
                    "$env:windir\system32\inetSrv\cachHttp.dll",
                    "$env:windir\system32\inetSrv\compStat.dll",
                    "$env:windir\system32\inetSrv\defDoc.dll",
                    "$env:windir\system32\inetSrv\dirList.dll",
                    "$env:windir\system32\inetSrv\protsUp.dll",
                    "$env:windir\system32\inetSrv\redirect.dll",
                    "$env:windir\system32\inetSrv\static.dll",
                    "$env:windir\system32\inetSrv\authAnon.dll",
                    "$env:windir\system32\inetSrv\cusTerr.dll",
                    "$env:windir\system32\inetSrv\logHttp.dll",
                    "$env:windir\system32\inetSrv\iisEtw.dll",
                    "$env:windir\system32\inetSrv\iisFreb.dll",
                    "$env:windir\system32\inetSrv\iisReQs.dll",
                    "$env:windir\system32\inetSrv\isApi.dll",
                    "$env:windir\system32\inetSrv\compDyn.dll",
                    "$env:windir\system32\inetSrv\authCert.dll",
                    "$env:windir\system32\inetSrv\authBas.dll",
                    "$env:windir\system32\inetSrv\authsspi.dll",
                    "$env:windir\system32\inetSrv\authMd5.dll",
                    "$env:windir\system32\inetSrv\modRqFlt.dll",
                    "$env:windir\system32\inetSrv\filter.dll",
                    "$env:windir\system32\rpcProxy\rpcProxy.dll",
                    "$env:windir\system32\inetSrv\validCfg.dll",