This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name MyCourses-BulkDownload | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://mycourses.ict.mahidol.ac.th/course/view.php?id=* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.0.2/jszip-utils.min.js | |
// @require https://fastcdn.org/FileSaver.js/1.1.20151003/FileSaver.min.js |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize | |
pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ErrorActionPreference = 'SilentlyContinue' | |
$Button = [System.Windows.MessageBoxButton]::YesNoCancel | |
$ErrorIco = [System.Windows.MessageBoxImage]::Error | |
$Ask = 'Do you want to run this as an Administrator? | |
Select "Yes" to Run as an Administrator | |
Select "No" to not run this as an Administrator | |
Select "Cancel" to stop the script.' | |
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sample 1 | |
$str = '< > : " / \ | ? *' | |
$strFixed = $str.Replace('<','_').Replace('>','_').Replace(':','_').Replace('"','_').Replace('/','_').Replace('\','_').Replace('|','_').Replace('?','_').Replace('*','_') | |
$strFixed | |
#Sample 2 | |
$strFixed2 = $str -replace '[<>:"/\\|?*]','_' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ask if the script have run as admin, if not, run as admin | |
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
$arguments = "& '" +$myinvocation.mycommand.definition + "'" | |
Start-Process powershell -Verb runAs -ArgumentList $arguments | |
Break | |
} | |
# PowerShell Window Title | |
$host.UI.RawUI.WindowTitle = "PS Title" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Ensure admin privileges | |
fltmc >nul 2>&1 || ( | |
echo Administrator privileges are required. | |
PowerShell Start -Verb RunAs '%0' 2> nul || ( | |
echo Right-click on the script and select "Run as administrator". | |
pause & exit 1 | |
) | |
exit 0 | |
) |
NewerOlder