function New-Object {
        param(
            [Parameter(Mandatory=$True, Valuefrompipeline = $True)]
            [string]$Object 
        )

           if($Object -ieq 'System.Net.WebClient' -or $Object -ieq 'Net.WebClient'){
            $WebClientObject = microsoft.powershell.utility\new-object Net.WebClient
            Add-Member -memberType ScriptMethod -InputObject $WebClientObject -Force -Name "DownloadFile" -Value {
                param([string]$url,[string]$destination)
                $data = "Script attempted to download from $($url) and save to: $($destination)" + "`r`n"
                UpdateReport($data)
				}
            Add-Member -memberType ScriptMethod -InputObject $WebClientObject -Force -Name "DownloadString" -Value {
                param([string]$url)
                $data= "Script attempted to download from: $($url)"+ "`r`n"
                UpdateReport($data)
				}
            return $WebClientObject
        }
        elseif($Object -ieq 'random'){
            $RandomObject = microsoft.powershell.utility\new-object Random
            Add-Member -memberType ScriptMethod -InputObject $RandomObject -Force -Name "next" -Value {
                param([int]$min,[int]$max)
                $RandomInt = Get-Random -Minimum $min -Maximum $max
                $data = "Script attempted to generate a random integer between $($min) and $($max). Value returned: $($RandomInt)" + "`r`n"
                UpdateReport($data)
				return $RandomInt
                }
            return $RandomObject
        }
        else{
            $UnknownObject = microsoft.powershell.utility\new-object $Object
            return $UnknownObject
        }


}
