1 2 3 4 5 6 7 8 9 |
# Obtener todo el script de PowerShell desde un servidor web $cmdlet = iwr "https://www.jesusninoc.com/codigo.ps1" # Crear un bloque con el contenido del script [System.Management.Automation.ScriptBlock]$bloque = Invoke-Expression ("{"+ $cmdlet +"}") # Localizar los cmdlets y variables de PowerShell en el blogue de código $bloque.Ast.FindAll( { $true }, $true) | Where-Object { $_.GetType().Name -eq 'CommandAst' } | select CommandElements $bloque.Ast.FindAll( { $true }, $true) | Where-Object { $_.GetType().Name -eq 'VariableExpressionAst' } | select variablePath |