Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Unable to update SQL Table

$
0
0

Hi Don,

Thanks for your reply.

I have attached the txt file for your reference.

Regards,
Mohammed

The SQL Query:

function Save-MSSystemInfo {
param (
[Parameter(Mandatory=$True,ValueFromPipeline=$True)]
[Object]$InputObject
)
PROCESS {
$query = @”
UPDATE MSSystemInfo SET
Manufacturer = ‘$($InputObject.Manufacturer.Replace(“‘”,”””))’,
RAM = $($InputObject.RAM),
OSVersion = ‘$($InputObject.OSVersion.Replace(“‘”,”””))’,
SPVersion = $($InputObject.SPVersion),
Model = ‘$($InputObject.Model.Replace(“‘”,”””))’,
OSBuild = $($InputObject.OSBuild),
Sockets = $($InputObject.Sockets),
WHERE ComputerName = ‘$($InputObject.ComputerName)’
“@
Write-Debug $query
Invoke-MOLDatabaseQuery -isSQLServer -connectionString $MSConnectionString -query $query

}
}


Viewing all articles
Browse latest Browse all 13067

Latest Images

Trending Articles



Latest Images