Skip to content

Instantly share code, notes, and snippets.

@cdiaz
Last active April 30, 2017 01:02
Show Gist options
  • Select an option

  • Save cdiaz/976e0de8f93d58902969a9302474be93 to your computer and use it in GitHub Desktop.

Select an option

Save cdiaz/976e0de8f93d58902969a9302474be93 to your computer and use it in GitHub Desktop.

Revisions

  1. cdiaz revised this gist Apr 30, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Wind
    ```

    ## Usage
    Save a Script https://gist.github.com/cdiaz/976e0de8f93d58902969a9302474be93#file-loginchaira-ps1 And
    Save this [Script](https://gist.github.com/cdiaz/976e0de8f93d58902969a9302474be93#file-loginchaira-ps1) and
    running from the Command Line (cmd)
    ```bash
    @powershell -ExecutionPolicy unrestricted ./loginchaira.ps1 'username' 'password'
  2. cdiaz revised this gist Apr 14, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -36,8 +36,8 @@ copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Wind
    ```

    ## Usage
    Save a Script https://gist.github.com/cdiaz/976e0de8f93d58902969a9302474be93#file-loginchaira-ps1
    Running from the Command Line (cmd)
    Save a Script https://gist.github.com/cdiaz/976e0de8f93d58902969a9302474be93#file-loginchaira-ps1 And
    running from the Command Line (cmd)
    ```bash
    @powershell -ExecutionPolicy unrestricted ./loginchaira.ps1 'username' 'password'
    ```
  3. cdiaz revised this gist Apr 14, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -36,8 +36,8 @@ copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Wind
    ```

    ## Usage

    Running Script from the Command Line (cmd)
    Save a Script https://gist.github.com/cdiaz/976e0de8f93d58902969a9302474be93#file-loginchaira-ps1
    Running from the Command Line (cmd)
    ```bash
    @powershell -ExecutionPolicy unrestricted ./loginchaira.ps1 'username' 'password'
    ```
  4. cdiaz revised this gist Apr 14, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions loginchaira.ps1
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,9 @@ $ie = New-Object -COM InternetExplorer.Application -Property @{
    }

    while($ie.busy) {
    #Focus window iexplore
    $window = Select-UIElement -ProcessName iexplore
    #Close Chaira Alert
    $window | Send-UIKeys '{ESCAPE}'
    }

  5. cdiaz revised this gist Apr 14, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -20,10 +20,10 @@ choco
    ###Install Wasp (Windows Automation Snap-in for Powershell)
    ```bash
    choco install wasp

    ```
    ####More info
    https://chocolatey.org/packages/wasp
    ```

    ####Copy the following modules to Windows PowerShell Module Path
    ```bash
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
  6. cdiaz revised this gist Apr 14, 2016. 1 changed file with 17 additions and 10 deletions.
    27 changes: 17 additions & 10 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,36 +1,43 @@
    ##Instructions:

    ####Download and Install Chocolatey (Package Manager for PowerShell)
    ```sh
    iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
    Run in the Command Line (cmd)

    ```bash
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
    ```
    #####Other installation methods:
    https://github.com/chocolatey/choco/wiki/Installation

    ####Make sure the chocolatey is include in $env:Path
    ```sh
    ```bash
    $env:path
    ```
    ####Check installed version
    ```sh
    ```bash
    choco
    ```
    ###Install Wasp (Windows Automation Snap-in for Powershell)
    ```sh
    ```bash
    choco install wasp

    ####More info
    https://chocolatey.org/packages/wasp
    ```
    ####Copy the following modules to Windows PowerShell Module Path
    ```sh
    ```bash
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
    ```sh
    ```bash
    copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
    ```sh
    ```bash
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```

    ## Usage

    Running Script from the Command Line (cmd)
    ```sh
    powershell.exe ./loginchaira.ps1 'username' 'password'
    ```bash
    @powershell -ExecutionPolicy unrestricted ./loginchaira.ps1 'username' 'password'
    ```
  7. cdiaz revised this gist Apr 14, 2016. 1 changed file with 13 additions and 6 deletions.
    19 changes: 13 additions & 6 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,23 @@
    #Instructions:
    ##Instructions:

    ###Download and Install Chocolatey (Package Manager for PowerShell)
    ####Download and Install Chocolatey (Package Manager for PowerShell)
    ```sh
    iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
    ```

    ###Make sure the chocolatey is include in $env:Path
    ####Make sure the chocolatey is include in $env:Path
    ```sh
    $env:path
    ```
    ###Check installed version
    ####Check installed version
    ```sh
    choco
    ```
    ###Install Wasp (Windows Automation Snap-in for Powershell)
    ```sh
    choco install wasp
    ```
    ###Copy the following modules to Windows PowerShell Module Path
    ####Copy the following modules to Windows PowerShell Module Path
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
    @@ -26,4 +26,11 @@ copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Window
    ```
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
    ```

    ## Usage

    Running Script from the Command Line (cmd)
    ```sh
    powershell.exe ./loginchaira.ps1 'username' 'password'
    ```
  8. cdiaz revised this gist Apr 14, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -19,11 +19,11 @@ choco install wasp
    ```
    ###Copy the following modules to Windows PowerShell Module Path
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    ```
  9. cdiaz revised this gist Apr 14, 2016. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,12 @@ choco
    choco install wasp
    ```
    ###Copy the following modules to Windows PowerShell Module Path
    + `copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    + `copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    + `copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    ```
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    ```
    ```sh
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    ```
  10. cdiaz revised this gist Apr 14, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,6 @@ choco
    choco install wasp
    ```
    ###Copy the following modules to Windows PowerShell Module Path
    ```sh
    + `copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    + `copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    + `copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    ```
  11. cdiaz revised this gist Apr 14, 2016. 1 changed file with 19 additions and 13 deletions.
    32 changes: 19 additions & 13 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,25 @@
    Instructions:
    #Instructions:

    #Download and Install Chocolatey (Package Manager for PowerShell)
    ###Download and Install Chocolatey (Package Manager for PowerShell)
    ```sh
    iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
    ```

    #Make sure the chocolatey is include in $env:Path
    ###Make sure the chocolatey is include in $env:Path
    ```sh
    $env:path

    #Check installed version
    ```
    ###Check installed version
    ```sh
    choco

    #Install Wasp (Windows Automation Snap-in for Powershell)
    ```
    ###Install Wasp (Windows Automation Snap-in for Powershell)
    ```sh
    choco install wasp

    #Copy the following modules to Windows PowerShell Module Path
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules

    ```
    ###Copy the following modules to Windows PowerShell Module Path
    ```sh
    + `copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    + `copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    + `copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules`
    ```
  12. cdiaz revised this gist Apr 14, 2016. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    Instructions:

    #Download and Install Chocolatey (Package Manager for PowerShell)
    iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

    #Make sure the chocolatey is include in $env:Path
    $env:path

    #Check installed version
    choco

    #Install Wasp (Windows Automation Snap-in for Powershell)
    choco install wasp

    #Copy the following modules to Windows PowerShell Module Path
    copy-item C:\ProgramData\chocolatey\lib\wasp -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    copy-item C:\ProgramData\chocolatey\lib\autoload -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    copy-item C:\ProgramData\chocolatey\lib\reflection -Recurse -Destination C:\Windows\system32\WindowsPowerShell\v1.0\Modules

  13. cdiaz created this gist Apr 14, 2016.
    19 changes: 19 additions & 0 deletions loginchaira.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    Import-Module wasp # Windows Automation Snap-in for Powershell

    $url = 'https://chaira.udla.edu.co/Chaira/Logon.aspx'
    $username = $args[0]
    $password = $args[1]

    $ie = New-Object -COM InternetExplorer.Application -Property @{
    Visible = $true
    Navigate = $url
    }

    while($ie.busy) {
    $window = Select-UIElement -ProcessName iexplore
    $window | Send-UIKeys '{ESCAPE}'
    }

    $ie.Document.getElementById("_Usuario").value = $username
    $ie.Document.getElementById("_Password").value = $password
    $ie.Document.getElementByID("ext-gen49").Click()