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
# Set the email server and login credentials | |
$smtpServer = "smtp.gmail.com" | |
$username = "[email protected]" | |
$password = "password" | |
$sendTo = "[email protected]" | |
# Create a PSCredential object using the login credentials | |
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $(ConvertTo-SecureString -String $password -AsPlainText -Force) |
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 | |
setlocal enabledelayedexpansion | |
:: Set character encoding to UTF-8 to support Estonian characters | |
@chcp 65001 | |
:: Check if argument was provided | |
if "%~1" == "" ( echo No arguments... & exit /b ) | |
:: Set string and initialize variables | |
set str=%1 |
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
' Set the locale to US English | |
SetLocale(1033) | |
Set objArgs = WScript.Arguments | |
' Check if the number of arguments passed to the script is less than or equal to 1 | |
' If no arguments were passed, display a message and quit the script | |
If objArgs.Count <= 1 Then | |
Wscript.Echo "Enter directory of pictures and target directory" | |
WScript.Quit 1 |
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
' See Visual Basic'i skript loeb käsurea argumendina määratud tekstifaili ning töötleb teksti, | |
' et leida ja loendada failis kõige populaarsemad sõnad. Skript loob kõigepealt regulaaravaldise objekti, | |
' mida kasutatakse tekstis olevate üksikute sõnade tuvastamiseks. Seejärel itereerib ta teksti läbi, lisades iga sõna sõnastikuobjektile, | |
' mis salvestab iga sõna arvu. Kui kõik sõnad on töödeldud, sorteerib skript sõnastiku sõnade arvu alusel kahanevas järjekorras ja | |
' väljastab N kõige populaarsemat sõna, kus N on määratud teise käsurea argumendina. | |
' Seejärel teostab skript sarnase protsessi, et leida ja loendada sõnu, mis sisaldavad apostrofe. | |
' Ta kasutab nende sõnade tuvastamiseks teistsugust regulaaravaldist ning loendab ja sorteerib neid samamoodi nagu eelmises etapis. | |
' Lõpuks väljastab skript failis olevate sõnade koguarvu ja unikaalsete sõnade arvu. |
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
# Prompt user to input start date, end date, and file name | |
# If no value is provided, use default values | |
if (!($startDate = Read-Host "Enter the start date (yyyy-mm-dd) [2022-12-01]")) { $startDate = "2022-12-01" } | |
if (!($endDate = Read-Host "Enter the end date (yyyy-mm-dd) [2022-12-31]")) { $endDate = "2022-12-31" } | |
if (!($fileName = Read-Host "Enter the file name [output.txt]")) { $fileName = "output.txt" } | |
$startTimeXPath = (Get-Date $startDate).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ') | |
$endTimeXPath = (Get-Date $endDate).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ') | |
# Set filters to retrieve events with Level 1 or 2 severity from specified date range |
NewerOlder