Files
Backup/_NDGOV_WindowsTeam/ITD.Infra-Servers-PowerShellUniversal.Test/ITD-PowerShellUniversal/Test-SQLThings.ps1
T
Zack Meier 1d304511b8 update
2026-04-15 15:45:50 -05:00

9 lines
656 B
PowerShell

# It all starts with a single line of powershell code.
$ServerInstance = "itdintsql22p1.nd.gov\INTSQL22P1"
$Database = "ITD-Systems-Automation"
$SnapshotTable = "Infra_VMware_VirtualMachine_VMSnapshots_NPD"
$SqlQuery = "INSERT INTO [Infra_VMware_VirtualMachine_VMSnapshots_NPD] (VMName, DateTime, RequestedBy, DurationHours,Status,ExpireDateTime,NotifyEmail,PSUJobIdRequest) Values ('itdscmt1.nd.gov', '2024/07/30 09:24:08', 'prvzmeier@nd.gov', 2, 'Requested', '2024/07/30 11:23:51','zmeier@nd.gov','');SELECT SCOPE_IDENTITY();"
(Invoke-Sqlcmd -ServerInstance $ServerInstance -Database $Database -Query $SqlQuery -Credential $Secret:itdpsu1 -Verbose)