.. index:: single: base64s base64s ======= Convert string to base64 -------------- :: Version : 1.0 File Name : base64.ps1 Author : Adewale Azeez - iamthecarisma@gmail.com Date : 2020 -------------- Convert a string to it base64 value, write the base64 result into a file, copy it to clipboard or generates a valid JSON Object. Syntax ------ .. code:: powershell base64s [-InputString] [-ToJson] [-AndCopyToClipboard] [-WriteToFile] [] Parameters ---------- -InputString :String ~~~~~~~~~~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? true Position? 1 Default value Accept pipeline input? false Accept wildcard characters? false =========================== ===== -ToJson [:SwitchParameter] ~~~~~~~~~~~~~~~~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? false Position? named Default value False Accept pipeline input? false Accept wildcard characters? false =========================== ===== -AndCopyToClipboard [:SwitchParameter] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? false Position? named Default value False Accept pipeline input? false Accept wildcard characters? false =========================== ===== -WriteToFile [:SwitchParameter] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? false Position? named Default value False Accept pipeline input? false Accept wildcard characters? false =========================== ===== CommonParameters ~~~~~~~~~~~~~~~~ This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). Inputs ------ The string to get it base64 value Outputs ------- Depends on switches EXAMPLE 1 --------- :: base64 "Normal String here" -WriteToFile The command encodes the string in base64 and writes it to file ‘str.base64’ in working directory where this script was executed EXAMPLE 2 --------- :: base64s "Normal String here" -AndCopyToClipboard The command encodes the string in base64 and copies the base64 value to clipboard EXAMPLE 3 --------- :: base64 "Normal String here" -ToJson The command encodes the string in base64 and generates a valid JSON object of the base64 value Related links ------------- - https://thecarisma.github.io/Cronux - https://philipm.at/2018/base64_in_powershell.html - https://www.reddit.com/r/PowerShell/comments/800jnc/converttobase64_encodes_files_to_base64/