$but_imei.Add_Click(
{
IMEI
dateusers
$phone = $itembox.SelectedItem
write-host = $phone
}
)
add-type -AssemblyName System.Windows.Forms
$Form = New-Object System.Windows.Forms.Form
$Form.Size = New-Object System.Drawing.Size(500,400)
$Form.StartPosition = "CenterParent"
$itembox = New-Object System.Windows.Forms.ComboBox
$itembox.AutoSize = 1
$itembox.Location = New-Object System.Drawing.Point(40,40)
$itembox.DataSource = @("Samsung A12", "Redmi Note A6", "Другое:", "4")
$but_imei = New-Object System.Windows.Forms.Button
$but_imei.text = "Записать"
$but_imei.Location = "400,100"
$but_imei.AutoSize = 1
$but_imei.Add_Click(
{
write-host $itembox.SelectedItem -fore green
}
)
$Form.Controls.Add($itembox)
$Form.Controls.Add($but_imei)
$Form.ShowDialog()
$Date1=(Get-Date).Date
$Date2=(Get-Date).Date.AddDays(7)
$NextBirthdays = Get-ADUser -filter "Enabled -eq 'True'" -properties birthday -SearchBase 'DC=firma,DC=local' |
Select-Object birthday, Name |
Where-Object { $_.birthday -ge $Date1 -and $_.birthday -le $Date2 }
# Формируем текст письма
$messagetemplate = " {0}: {1}`r`n"
$message = ""
foreaach ($b in $NextBirthdays) {
$message += $messagetemplate -f $b.Name, $b.birthday
}
# Ну и тут их шлём кому попало
Send-MailMessage ....
ProgramError: TypeError: 'BigInteger' - определение отсутствует
# PSv7 $cert = [Convert]::ToBase64String((Get-Content D:\Path\To\Certificate.pfx/cer -AsByteStream), 'InsertLineBreaks')
# PSv5.1 $cert = [Convert]::ToBase64String((Get-Content D:\Path\To\Certificate.pfx/cer -Encoding Byte), 'InsertLineBreaks')
$Cert = @"
MIILYgIBAzCCCx4GCSqGSIb3DQEH
.....
.....
.....
1y1lZqkQICB9A=
"@
#LocalMachine
$location = [System.Security.Cryptography.X509Certificates.StoreLocation]::CurrentUser
#ls Cert:\CurrentUser\
#ls Cert:\LocalMachine\
$storeName = 'TrustedPublisher'
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new($storeName, $location)
$store.Open('ReadWrite')
[byte[]]$content = [Convert]::FromBase64String($cert)
$certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($content)
$store.Add($certificate)
$store.Close()
function Make-LLD () {
For ($i=1; $i -le 3; $i++){
$VPNName = ...
$VPNStatus =
if ($VPNName -eq 'NoSuchInstance'){Break}
@{'#VPN.NAME' = $VPNName; '#VPN.NAME.STATUS' = $VPNStatus}
}
}
$vpns = Make-LLD
$result = ConvertTo-Json @{"data" = [array]$vpns} -Compress
Write-Host $result
postsFile = open('posts.txt','r+') # Открываем файл на чтение и запись
posts = postsFile.read().splitlines() # Читаем файл и помещаем строки в список posts
у вас будет подключение к базе данных, создание таблицы, если надоpostsFile.writelines(url+'\n') # И ссылку записываем в файл posts.txt