Add-Type -AssemblyName System.Windows.Forms
# Создание диалогового окна сохранения файла
$saveFileDialog = New-Object System.Windows.Forms.SaveFileDialog
$saveFileDialog.InitialDirectory = [System.Environment]::GetFolderPath('Desktop') # Стартовый каталог
$saveFileDialog.Filter = "Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*" # Фильтр типов файлов
$saveFileDialog.Title = "Выберите место для сохранения файла"
$saveFileDialog.DefaultExt = "txt" # Расширение по умолчанию
# Отображение диалога и обработка результата
if ($saveFileDialog.ShowDialog() -eq "OK") {
$savePath = $saveFileDialog.FileName
Write-Host "Файл будет сохранен по пути: $savePath"
} else {
Write-Host "Сохранение отменено пользователем."
}
for i in */; do zip -r "${i%/}.zip" "$i"; done
find . -type f -name '*.db' -exec zip -m {}.zip {} \;
for %%F in ("%source_folder%\*") do (
call rling "%%~fF" "%compare_folder%"
type result.txt >> %output_file%
del /q result.txt
if (!(Test-Path $outputFile)) {
New-Item -Path $outputFile -Force | Out-Null
}
Get-ChildItem -Path $sourceFolder -File | ForEach-Object {
& rling $_.FullName $compareFolder
Get-Content -Path '.\result.txt' | Add-Content -Path $outputFile
Remove-Item -Path '.\result.txt' -ErrorAction SilentlyContinue
}
-Credential
Specifies the account used by the service as the Service Logon Account.
где каждому сотруднику присвоен ПК
$threadslimit = 8
$collection = @{}
$synccollection = [System.Collections.Hashtable]::Synchronized($collection)
1..1000 | ForEach-Object {
$data = @('some', 'valuable', 'text', 'data')
$synccollection.Add($_, $data)
}
#выводим созданную коллекцию до изменений, просто чтобы можно было сравнить
$synccollection
$keys = @($synccollection.Keys)
$keys | ForEach-Object -Parallel {
$synccollectionscope = $using:synccollection
# Здесь на самом деле какая-то функция, которая возвращает строку
$format = 'Changed data'
# Изменяем одно из полей, напоминаю, по ключам лежат массивы
$synccollectionscope[$_][3] = $format
# Тут вывод чтобы просто отслеживать выполнение скрипта
Write-Output "Data was changed"
} -ThrottleLimit $threadslimit
# Вывод самой коллекции в консоль, чтобы убедиться, что значения поменялись
$synccollection
Under Exchange 2013 Architecture:
“Second, Outlook clients no longer connect to a server FQDN as they have done in all previous versions of Exchange. Outlook uses Autodiscover to create a new connection point comprised of mailbox GUID, @ symbol, and the domain portion of the user’s primary SMTP address. This simple change results in a near elimination of the unwelcome message of “Your administrator has made a change to your mailbox. Please restart.” Only Outlook 2007 and higher versions are supported with Exchange 2013.”
$localuser = Get-LocalUser -Name $USERNAME
$localuser | Remove-LocalUser -Confirm:$false
$userprofile = Get-CimInstance -Class Win32_UserProfile | Where-Object { $_.SID -eq $localuser.SID }
$userprofile | Remove-CimInstance -Confirm:$false
Вроде бы с помощью cmd и Powershell такое провернуть нельзяэто кто вам такое сказал?