Results 1 to 13 of 13

Thread: PowerShell

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Big Blue IBM's Avatar
    Join Date: Dec:2007
    Location:
    Posts: 260

    PowerShell

    .
    PS Win , .
    ?
    Last edited by IBM; 11th December 2015 at 16:08.
    : , ....

  2. #2
    Registered User xploda's Avatar
    Join Date: Dec:2010
    Location:
    Posts: 3,012
    SYSTEM .

  3. #3
    Registered User autosvet's Avatar
    Join Date: Sep:2004
    Location: Edinburgh
    Posts: 7,748
    , ?

  4. #4
    The Big Blue IBM's Avatar
    Join Date: Dec:2007
    Location:
    Posts: 260
    Quote Originally Posted by autosvet View Post
    , ?
    , . - .

    :


    Code:
    $DateOffset=0
    $CurrentDate=(get-date).AddDays($DateOffset).ToString("ddMMyyyy")
    $CheckDirectory="C:\Users\Administrator\Desktop"
    $FileDate=((Get-ChildItem -Path $CheckDirectory| Sort-Object LastWriteTime -Descending | Select-Object -First 1).LastWriteTime).ToString("ddMMyyyy")
    $CompareDate=$CurrentDate.CompareTo($FileDate)
    $FileSize= ((Get-ChildItem -Path $CheckDirectory| Sort-Object LastWriteTime -Descending | Select-Object -First 1).length).ToString("")
    if ($CompareDate -eq 0)
    {
     if ( $FileSize -gt 0 )
     {
     C:\zabbix\agent\bin\win64\zabbix_sender.exe -c C:\zabbix\agent\conf\zabbix_agentd.win.conf -k TNbackup.status -o Finished successfully
     }
     Else
     {
      C:\zabbix\agent\bin\win64\zabbix_sender.exe -c C:\zabbix\agent\conf\zabbix_agentd.win.conf -k TNbackup.lasterror -o %Date% %Time%
     }
    }
    Else
    {
     ""
    }
    Last edited by IBM; 12th December 2015 at 11:46.
    : , ....

  5. #5
    motherfather The Penalty's Avatar
    Join Date: Mar:2002
    Location:
    Posts: 20,472
    Quote Originally Posted by IBM View Post
    , . - .

    :


    Code:
    $DateOffset=0
    $CurrentDate=(get-date).AddDays($DateOffset).ToString("ddMMyyyy")
    $CheckDirectory="C:\Users\Administrator\Desktop"
    $FileDate=((Get-ChildItem -Path $CheckDirectory| Sort-Object LastWriteTime -Descending | Select-Object -First 1).LastWriteTime).ToString("ddMMyyyy")
    $CompareDate=$CurrentDate.CompareTo($FileDate)
    $FileSize= ((Get-ChildItem -Path $CheckDirectory| Sort-Object LastWriteTime -Descending | Select-Object -First 1).length).ToString("")
    if ($CompareDate -eq 0)
    {
     if ( $FileSize -gt 0 )
     {
     C:\zabbix\agent\bin\win64\zabbix_sender.exe -c C:\zabbix\agent\conf\zabbix_agentd.win.conf -k TNbackup.status -o Finished successfully
     }
     Else
     {
      C:\zabbix\agent\bin\win64\zabbix_sender.exe -c C:\zabbix\agent\conf\zabbix_agentd.win.conf -k TNbackup.lasterror -o %Date% %Time%
     }
    }
    Else
    {
     ""
    }
    .

    • , -
    • Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us
    • Soul platinum 1 and 2. See? It's not the game - you suck.


  6. #6
    Registered User autosvet's Avatar
    Join Date: Sep:2004
    Location: Edinburgh
    Posts: 7,748
    The Penalty.

    . PowerShell - DateTime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |