Bonjour,
mon script actuellement fait des captures toutes les 15 secondes mais mon image est écrasée a chaque fois.
J'aimerai garder chaque image et toutes les 15 secondes .
Voici le script

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

function Get-ScreenCapture

{

    param(   

    [Switch]$OfWindow       

    )
    

    begin {

        Add-Type -AssemblyName System.Drawing

        $jpegCodec = [Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() |

            Where-Object { $_.FormatDescription -eq "JPEG" }

    }

    process {

        Start-Sleep -Milliseconds 250

        if ($OfWindow) {           

            [Windows.Forms.Sendkeys]::SendWait("%{PrtSc}")       

        } else {

            [Windows.Forms.Sendkeys]::SendWait("%{PrtSc}")       

        }

        Start-Sleep -Milliseconds 250

        $bitmap = [Windows.Forms.Clipboard]::GetImage()   

        $ep = New-Object Drawing.Imaging.EncoderParameters 

        $ep.Param[0] = New-Object Drawing.Imaging.EncoderParameter ([System.Drawing.Imaging.Encoder]::Quality, [long]100) 

        $computername = gc env:computername

        $bitmap.Save("C:\wawa\Sreen\$computername.jpg", $jpegCodec, $ep)

    }

}

gwmi Win32_SystemEnclosure | % {$NameBios = $_.SMBIOSAssetTag}

$DataFolder="C:\wawa\Sreen\Shoot\";

$limit = (Get-Date).AddDays(-3)


$i=0;

Get-Childitem $DataFolder -recurse | ?{!$_.PSIsContainer -and ($_.CreationTime -lt (get-Date).adddays(-4))} | remove-item

while ($i -le 5) {

    Get-ScreenCapture

    start-sleep -Seconds 15

}
Quelqu’un a t'il une solution ?
Merci