Quantcast
Channel: foreach | Operating systems, scripting, PowerShell and security | jesusninoc.com
Viewing all articles
Browse latest Browse all 409

Encontrar cmdlets en un código de PowerShell que se encuentra en una web

$
0
0

$url = "https://www.jesusninoc.com/2017/06/22/encontrar-cmdlets-en-un-bloque-de-powershell/"
$result = Invoke-WebRequest $url
#La etiqueta que tenemos buscar es: class="crayon-plain-wrap"

$code = $result.AllElements | Where Class -eq “crayon-plain-wrap” | %{$_.innerText}

[System.Management.Automation.PSParser]::Tokenize($code,[ref]$null) |
ForEach-Object {
    if ($_.Type -eq 'Command') {
        $_.content
    }
}

The post Encontrar cmdlets en un código de PowerShell que se encuentra en una web appeared first on Scripting and security.


Viewing all articles
Browse latest Browse all 409

Trending Articles