Skip to content

Instantly share code, notes, and snippets.

#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()
{
foreach ($file in $FileList)
{
$newFileURI = $TestDir + $file + $TestDirExtension
$makeNewFile = Invoke-RestMethod $newFileURI -Method POST -Body $jsonobject -ContentType application/json
}
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
}
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
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
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.
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.
foreach ($dir in $directories)
{
New-Item $dirPath -type directory -value #value for including directory data or metadata
}
foreach ($file in $Files)
{
New-Item ($dirPath + $FileName) -ItemType file -value #value for including file data
Join-Path -Parent $dirPath -ChildPath $FileName
}
foreach ($dir in $directories)
{
New-Item $dirPath -type directory -value #value for including directory data or metadata
foreach ($file in $Files)
{
New-Item ($dirPath + $FilePath) -ItemType file -value #value for including file data
}
}
$connectionString = "Server= $SQLServer, $PORT;Database=$SQLDBName;User ID= $Username; Password= $Password;"
$conn = New-Object System.Data.SqlClient.SqlConnection
$conn.ConnectionString = $connectionString
$cmd = New-Object System.Data.SqlClient.SqlCommand
$cmd.commandtext = $query
$conn.open()
if ($conn.Open() -eq $true)
{