Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Save-ScreenSaver
- { Param([parameter(Mandatory=$true)]
- [String]
- $dbPath,
- # [parameter(Mandatory=$true,
- # ValueFromPipelineByPropertyName=$true)]
- # [DateTime]
- # $Epoch,
- [parameter(Mandatory=$true,
- ValueFromPipelineByPropertyName=$true)]
- [String[]]
- $__PATH,
- [parameter(Mandatory=$true,
- ValueFromPipelineByPropertyName=$true)]
- [Boolean]
- $ScreenSaverActive,
- [parameter(Mandatory=$true,
- ValueFromPipelineByPropertyName=$true)]
- [String]
- $ScreenSaverExecutable,
- [parameter(Mandatory=$true,
- ValueFromPipelineByPropertyName=$true)]
- [Boolean]
- $ScreenSaverSecure,
- [parameter(Mandatory=$true,
- ValueFromPipelineByPropertyName=$true)]
- [UInt32]
- $ScreenSaverTimeout
- )
- Begin {
- $connection = New-Object System.Data.OleDb.OleDbConnection
- $connection.ConnectionString =
- "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$dbPath;Persist Security Info=False"
- $connection.Open()
- }
- $command = New-Object System.Data.OleDb.OleDbCommand
- $command.Connection = $connection
- $command.CommandText = "INSERT INTO Screen" +
- "(__PATH, ScreenSaverActive, ScreenSaverExecutable, " +
- "ScreenSaverSecure, ScreenSaverTimeout) " +
- "VALUES(?, ?, ?, ?, ?)"
- Process {
- # Ejecutar el command, asignando primeramente los parĂ¡metros
- # recibidos del pipe"
- }
- End {
- $connection.Close()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement