Advertisement
dev247

PS Profile

May 9th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set-PSReadlineOption -BellStyle None
  2.  
  3. Function Base64Encode {
  4.     [CmdletBinding()]
  5.     Param
  6.     (
  7.         [Parameter(Mandatory = $True)]
  8.         [String]$String
  9.     )
  10.     [convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$String"))
  11. }
  12.  
  13. Function Base64Decode {
  14.     [CmdletBinding()]
  15.     Param
  16.     (
  17.         [Parameter(Mandatory = $True)]
  18.         [String]$String
  19.     )
  20.     [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($String))
  21. }
  22.  
  23. Function Snag {
  24.     [CmdletBinding()]
  25.     Param
  26.     (
  27.         [Parameter(Mandatory = $True)]
  28.         [String]$URL,
  29.         [ValidateSet("Content","Headers","Raw","InputFields","Forms","Status","Links")]
  30.         [String]$Type
  31.     )
  32.     If ($Type) {
  33.         Switch ($Type) {
  34.             "Content" { (Invoke-WebRequest -Uri $URL).Content }
  35.             "Headers" { (Invoke-WebRequest -Uri $URL).Headers }
  36.             "Raw" { (Invoke-WebRequest -Uri $URL).RawContent }
  37.             "InputFields" { (Invoke-WebRequest -Uri $URL).InputFields }
  38.             "Forms" { (Invoke-WebRequest -Uri $URL).Forms }
  39.             "Status" { (Invoke-WebRequest -Uri $URL).StatusCode }
  40.             "Links" { (Invoke-WebRequest $URL).Links }
  41.             "Full" { Invoke-WebRequest -Uri $URL }
  42.         }
  43.     } Else {
  44.         (Invoke-WebRequest -Uri $URL).Content
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement