Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set-PSReadlineOption -BellStyle None
- Function Base64Encode {
- [CmdletBinding()]
- Param
- (
- [Parameter(Mandatory = $True)]
- [String]$String
- )
- [convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$String"))
- }
- Function Base64Decode {
- [CmdletBinding()]
- Param
- (
- [Parameter(Mandatory = $True)]
- [String]$String
- )
- [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($String))
- }
- Function Snag {
- [CmdletBinding()]
- Param
- (
- [Parameter(Mandatory = $True)]
- [String]$URL,
- [ValidateSet("Content","Headers","Raw","InputFields","Forms","Status","Links")]
- [String]$Type
- )
- If ($Type) {
- Switch ($Type) {
- "Content" { (Invoke-WebRequest -Uri $URL).Content }
- "Headers" { (Invoke-WebRequest -Uri $URL).Headers }
- "Raw" { (Invoke-WebRequest -Uri $URL).RawContent }
- "InputFields" { (Invoke-WebRequest -Uri $URL).InputFields }
- "Forms" { (Invoke-WebRequest -Uri $URL).Forms }
- "Status" { (Invoke-WebRequest -Uri $URL).StatusCode }
- "Links" { (Invoke-WebRequest $URL).Links }
- "Full" { Invoke-WebRequest -Uri $URL }
- }
- } Else {
- (Invoke-WebRequest -Uri $URL).Content
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement