Removing New-Object proxy function

This commit is contained in:
mattifestation 2014-08-09 20:26:17 -04:00
parent 36e1e29987
commit 2e00756b59
3 changed files with 1 additions and 95 deletions

View File

@ -108,10 +108,6 @@ Marshals data from an unmanaged block of memory in an arbitrary process to a new
A proxy function used to extend the built-in Get-Member cmdlet. It adds the '-Private' parameter allowing you to display non-public .NET members
#### `New-Object`
A proxy function for New-Object that accepts a CLSID with the -ComObject parameter.
#### `Get-Strings`
Dumps strings from files in both Unicode and Ascii. This cmdlet replicates the functionality of strings.exe from Sysinternals.

View File

@ -1,90 +0,0 @@
function New-Object
{
[CmdletBinding(DefaultParameterSetName='Net')]
param(
[Parameter(ParameterSetName='Net', Mandatory=$true, Position=0)]
[string]
${TypeName},
[Parameter(ParameterSetName='Com', Mandatory=$true, Position=0)]
[string]
${ComObject},
[Parameter(ParameterSetName='Net', Position=1)]
[Alias('Args')]
[System.Object[]]
${ArgumentList},
[Parameter(ParameterSetName='Com')]
[switch]
${Strict},
[System.Collections.IDictionary]
${Property})
begin
{
Set-StrictMode -Version 2
try {
$outBuffer = $null
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))
{
$PSBoundParameters['OutBuffer'] = 1
}
$ClsidPresent = $true
$Guid = [Guid]::NewGuid()
try
{
$Guid = [Guid] $PSBoundParameters['ComObject']
}
catch
{
$ClsidPresent = $false
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('New-Object', [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
$steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
}
} catch {
throw
}
}
process
{
if ($ClsidPresent)
{
[Activator]::CreateInstance([Type]::GetTypeFromCLSID($Guid), $Property)
}
else
{
try {
$steppablePipeline.Process($_)
} catch {
throw
}
}
}
end
{
if (!$ClsidPresent)
{
try {
$steppablePipeline.End()
} catch {
throw
}
}
}
<#
.ForwardHelpTargetName New-Object
.ForwardHelpCategory Cmdlet
#>
}

View File

@ -76,7 +76,7 @@ ModuleList = @(@{ModuleName = 'ReverseEngineering'; ModuleVersion = '1.0.0.0'; G
FileList = 'ReverseEngineering.psm1', 'ReverseEngineering.psd1', 'Get-ILDisassembly.ps1', 'Get-NtSystemInformation.format.ps1xml',
'Get-NtSystemInformation.ps1', 'Get-Member.ps1', 'Get-MethodAddress.ps1', 'Get-PEB.format.ps1xml',
'Get-PEB.ps1', 'Get-Strings.ps1', 'Get-StructFromMemory.ps1', 'ConvertTo-String.ps1',
'Get-Entropy.ps1', 'New-Object.ps1', 'Get-ILDisassembly.format.ps1xml', 'ProcessModuleTrace.ps1', 'Usage.md'
'Get-Entropy.ps1', 'Get-ILDisassembly.format.ps1xml', 'ProcessModuleTrace.ps1', 'Usage.md'
# Private data to pass to the module specified in RootModule/ModuleToProcess
# PrivateData = ''