Skip to content

Instantly share code, notes, and snippets.

function selectPOSData ($Server, $Database, $query, $Username, $Password) {
$Connection = New-Object System.Data.SQLClient.SQLConnection
$Connection.ConnectionString = "server='$Server';database='$Database';User ID= $Username; Password= $Password;"
$Connection.Open()
$Command = New-Object System.Data.SQLClient.SQLCommand
$Command.Connection = $Connection
$Command.CommandText = $query
#Set the SqlDataAdapter's SelectCommand.
# Fill the DataSet.
function selectPOSData ($Server, $Database, $Username, $Password) {
$Connection = New-Object System.Data.SQLClient.SQLConnection
$Connection.ConnectionString = "server=$Server;database=$Database;User ID= $Username; Password= $Password;"
$Command = New-Object System.Data.SQLClient.SQLCommand
$Connection.Open()
$Command.Connection = $Connection
$Command.CommandText = 'somequery'
# Fill the DataSet.
System.Windows.Markup.XamlParseException occurred
HResult=-2146233087
LineNumber=6
LinePosition=9
Message='The invocation of the constructor on type 'Verifone.Utility.MainWindow' that matches the specified binding constraints threw an exception.' Line number '6' and line position '9'.
Source=PresentationFramework
StackTrace:
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
InnerException:
HResult=-2146233080
System.Windows.Markup.XamlParseException occurred
HResult=-2146233087
LineNumber=6
LinePosition=9
Message='The invocation of the constructor on type 'app.MainWindow' that matches the specified binding constraints threw an exception.' Line number '6' and line position '9'.
Source=PresentationFramework
StackTrace:
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
InnerException:
HResult=-2146233080
function createRESTFileStructure($path, $directories, $Files)
{
$RestURL = "myURL"
foreach ($dir in $directories)
{
$newPath = $RestURL + $dir
$response = Invoke-RestMethod $newPath -Method POST
New-Item $newPath -type directory
}
foreach ($file in $FileList)
{
$newFileURI = $TestDir + $file + $TestDirExtension
$makeNewFile = Invoke-RestMethod $newFileURI -Method POST -Body $jsonobject -ContentType application/json
}
#region Variables
public string path { get; set; }
public string searchTerm { get; set; }
public int lineNumberCount { get; set; }
public List<string> FileList { get; set; }
#endregion
public GetFile()
{