Version 1.2.1.0 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot.
ಶೆಡ್ಯೂಲ್ ಮಾಡಿದ ಟಾಸ್ಕ್ ಉದಾಹರಣೆ
ಈ ಉದಾಹರಣೆ ಪ್ರತಿದಿನವೂ DNS ಡಿಬಗ್ ಲಾಗ್ಗಳನ್ನು ಪ್ರಕ್ರಿಯೆಗೊಳಿಸಲು ಪವರ್ಶೆಲ್ ಸ್ಕ್ರಿಪ್ಟ್ ಅನ್ನು ಚಾಲನೆ ಮಾಡುವ ವಿಂಡೋಸ್ ಶೆಡ್ಯೂಲ್ ಮಾಡಿದ ಟಾಸ್ಕ್ ಅನ್ನು ಸೃಷ್ಟಿಸುವ ವಿಧಾನವನ್ನು ತೋರಿಸುತ್ತದೆ.
For AI agents: a documentation index is available at /llms.txt; a markdown version of this page is available at /v1.2.1.0/kn/docs/examples/scheduletask/index.md.
ಈ ಸ್ಕ್ರಿಪ್ಟ್ ಪ್ರತಿದಿನವೂ ಬೆಳಗ್ಗೆ 2:00 ಗಂಟೆಗೆ ಚಾಲನೆಗೊಳ್ಳುವ ವಿಂಡೋಸ್ ಶೆಡ್ಯೂಲ್ ಮಾಡಿದ ಟಾಸ್ಕ್ ಅನ್ನು ಸೃಷ್ಟಿಸುತ್ತದೆ. ಇದು ಮೋಡ್ಯೂಲ್ ಅನ್ನು ಆಮದುಮಾಡಿ, ಸ್ಕ್ರಿಪ್ಟ್ ಕಾರ್ಯಗತಗೊಳ್ಳುವ ಫೋಲ್ಡರ್ನಲ್ಲಿರುವ ಎಲ್ಲಾ ಲಾಗ್ ಫೈಲ್ಗಳನ್ನು (ಈ ಉದಾಹರಣೆಯಲ್ಲಿ “C:\Administration\Logs\DNS”) ಪ್ರಕ್ರಿಯೆಗೊಳಿಸುತ್ತದೆ. ಪ್ರಕ್ರಿಯೆ ಔಟ್ಪುಟ್ ಅನ್ನು ZIP-ಫೈಲ್ಗಳಾಗಿ ಸಂಕುಚಿತಗೊಳಿಸುತ್ತದೆ ಮತ್ತು ಮೂಲವನ್ನು ತೆಗೆದುಹಾಕಿ ಸ್ವಚ್ಛತೆ ಕಾಪಾಡುತ್ತದೆ.
$actionParams = @{
Execute = "powershell.exe"
Argument = '-ExecutionPolicy RemoteSigned -Command "Import-Module DNSServer.DebugLogParser; Get-ChildItem .\*.log | Sort-Object lastwritetime, Name -Descending | Convert-DNSDebugLogFile -ComputerName $env:COMPUTERNAME -Delimiter \";\" -OutputType Both -ContextFilter Packet -OutputCulture sv-SE -CompressOutput"'
WorkingDirectory = "C:\Administration\Logs\DNS"
}
$Action = New-ScheduledTaskAction @actionParams
$Trigger = New-ScheduledTaskTrigger -Daily -At "2:00AM"
Register-ScheduledTask -TaskName "Process DNS Logs" -Action $Action -Trigger $Trigger -Description "Convert DNS debug logs to CSV daily"