Anlage des Repos
This commit is contained in:
85
knowlegbase/XML Händling/DB-XML-Test/Vorlage/inventory.xml
Normal file
85
knowlegbase/XML Händling/DB-XML-Test/Vorlage/inventory.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type='text/xsl' href='style.xsl'?>
|
||||
<!--List of machines-->
|
||||
<Machines current="True" manager="Tobias">
|
||||
<!--1. machine details-->
|
||||
<Machine test="1765931008">
|
||||
<Name>Server0001</Name>
|
||||
<IP>140.53.129.236</IP>
|
||||
<GUID>f0b24016-deed-4720-97ad-208354c9b3e5</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--2. machine details-->
|
||||
<Machine test="1127464827">
|
||||
<Name>Server0002</Name>
|
||||
<IP>32.97.25.94</IP>
|
||||
<GUID>85448405-0721-4741-b673-8a4053434e49</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--3. machine details-->
|
||||
<Machine test="382962770">
|
||||
<Name>Server0003</Name>
|
||||
<IP>45.251.154.18</IP>
|
||||
<GUID>3f8fe373-f34f-48c4-ae40-77616ba105c3</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--4. machine details-->
|
||||
<Machine test="737970063">
|
||||
<Name>Server0004</Name>
|
||||
<IP>146.152.239.147</IP>
|
||||
<GUID>78f1d4c1-44c3-4c30-a30e-2f9220ee9b16</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--5. machine details-->
|
||||
<Machine test="460663881">
|
||||
<Name>Server0005</Name>
|
||||
<IP>158.150.117.0</IP>
|
||||
<GUID>66d08948-a0b0-4fde-be07-7188389063ee</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--6. machine details-->
|
||||
<Machine test="1159851223">
|
||||
<Name>Server0006</Name>
|
||||
<IP>51.219.245.116</IP>
|
||||
<GUID>ed7d6283-2bf1-4ad9-800a-18bdf8b20a1b</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--7. machine details-->
|
||||
<Machine test="52321713">
|
||||
<Name>Server0007</Name>
|
||||
<IP>203.255.136.135</IP>
|
||||
<GUID>84aba42c-7ba6-4090-a98e-19bb2e8750dd</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--8. machine details-->
|
||||
<Machine test="2132700933">
|
||||
<Name>Server0008</Name>
|
||||
<IP>78.158.207.16</IP>
|
||||
<GUID>12aef528-e7be-4074-b2b8-a5525aa07856</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--9. machine details-->
|
||||
<Machine test="1993979073">
|
||||
<Name>Server0009</Name>
|
||||
<IP>210.119.89.71</IP>
|
||||
<GUID>e0c6e3c9-cd94-42d3-a676-d6a4ec79b2c3</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--10. machine details-->
|
||||
<Machine test="285437851">
|
||||
<Name>Server0010</Name>
|
||||
<IP>227.39.197.199</IP>
|
||||
<GUID>c280ff88-f349-4c38-b546-7212e4001ab1</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
</Machines>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tours>
|
||||
<format>v1</format>
|
||||
<export_date>2014-08-08T23:30</export_date>
|
||||
<tour>
|
||||
<tour_date>2014-09-03T09:00</tour_date>
|
||||
<tour_no>654321</tour_no>
|
||||
<driver>
|
||||
<driverID>vetra007</driverID>
|
||||
<!--name>Roland Becker</name>
|
||||
<licenseplate>DU-AL785</licenseplate>
|
||||
<company_name>Becker GmbH</company_name>
|
||||
<mobile>+33 1234567</mobile-->
|
||||
</driver>
|
||||
<deliveries>
|
||||
<delivery>
|
||||
<order_no>4318796</order_no>
|
||||
<remark>* kein Sattelzug möglich</remark>
|
||||
<delivery_note>
|
||||
<delivery_noteID>123456ABC</delivery_noteID>
|
||||
</delivery_note>
|
||||
<recipient>
|
||||
<customerID>789465</customerID>
|
||||
<delivery_address>
|
||||
<country_iso>BE</country_iso>
|
||||
<zip>1000</zip>
|
||||
<location>Bruxelles</location>
|
||||
<location_extra>Centre</location_extra>
|
||||
<street>Av. Vanelde 63</street>
|
||||
</delivery_address>
|
||||
<company>
|
||||
<name>Giovanni</name>
|
||||
<subsidiary>Filiale Dortmund</subsidiary>
|
||||
<landline>+32 654321</landline>
|
||||
</company>
|
||||
</recipient>
|
||||
<delivery_positions>
|
||||
<delivery_position>
|
||||
<original_sender>Bayrol</original_sender>
|
||||
<product_name>Technoil</product_name>
|
||||
<actual_weight unit="kg">893.0</actual_weight>
|
||||
<quantity_to_deliver unit="liter">1004.0</quantity_to_deliver>
|
||||
<mhes>
|
||||
<mhe>
|
||||
<type>IBC</type>
|
||||
<id>10199999</id>
|
||||
</mhe>
|
||||
</mhes>
|
||||
</delivery_position>
|
||||
</delivery_positions>
|
||||
</delivery>
|
||||
</deliveries>
|
||||
</tour>
|
||||
</tours>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
85
knowlegbase/XML Händling/DB-XML-Test/inventory.xml
Normal file
85
knowlegbase/XML Händling/DB-XML-Test/inventory.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type='text/xsl' href='style.xsl'?>
|
||||
<!--List of machines-->
|
||||
<Machines current="True" manager="Tobias">
|
||||
<!--1. machine details-->
|
||||
<Machine test="1765931008">
|
||||
<Name>Server0001</Name>
|
||||
<IP>140.53.129.236</IP>
|
||||
<GUID>f0b24016-deed-4720-97ad-208354c9b3e5</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--2. machine details-->
|
||||
<Machine test="1127464827">
|
||||
<Name>Server0002</Name>
|
||||
<IP>32.97.25.94</IP>
|
||||
<GUID>85448405-0721-4741-b673-8a4053434e49</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--3. machine details-->
|
||||
<Machine test="382962770">
|
||||
<Name>Server0003</Name>
|
||||
<IP>45.251.154.18</IP>
|
||||
<GUID>3f8fe373-f34f-48c4-ae40-77616ba105c3</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--4. machine details-->
|
||||
<Machine test="737970063">
|
||||
<Name>Server0004</Name>
|
||||
<IP>146.152.239.147</IP>
|
||||
<GUID>78f1d4c1-44c3-4c30-a30e-2f9220ee9b16</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--5. machine details-->
|
||||
<Machine test="460663881">
|
||||
<Name>Server0005</Name>
|
||||
<IP>158.150.117.0</IP>
|
||||
<GUID>66d08948-a0b0-4fde-be07-7188389063ee</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--6. machine details-->
|
||||
<Machine test="1159851223">
|
||||
<Name>Server0006</Name>
|
||||
<IP>51.219.245.116</IP>
|
||||
<GUID>ed7d6283-2bf1-4ad9-800a-18bdf8b20a1b</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--7. machine details-->
|
||||
<Machine test="52321713">
|
||||
<Name>Server0007</Name>
|
||||
<IP>203.255.136.135</IP>
|
||||
<GUID>84aba42c-7ba6-4090-a98e-19bb2e8750dd</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--8. machine details-->
|
||||
<Machine test="2132700933">
|
||||
<Name>Server0008</Name>
|
||||
<IP>78.158.207.16</IP>
|
||||
<GUID>12aef528-e7be-4074-b2b8-a5525aa07856</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--9. machine details-->
|
||||
<Machine test="1993979073">
|
||||
<Name>Server0009</Name>
|
||||
<IP>210.119.89.71</IP>
|
||||
<GUID>e0c6e3c9-cd94-42d3-a676-d6a4ec79b2c3</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
<!--10. machine details-->
|
||||
<Machine test="285437851">
|
||||
<Name>Server0010</Name>
|
||||
<IP>227.39.197.199</IP>
|
||||
<GUID>c280ff88-f349-4c38-b546-7212e4001ab1</GUID>
|
||||
<Information info1="some info" info2="more info">RawContent</Information>
|
||||
<CodeSegment info3="another attribute"><![CDATA[this is untouched code and can contain special characters /\@<>]]></CodeSegment>
|
||||
</Machine>
|
||||
</Machines>
|
||||
78
knowlegbase/XML Händling/Entwicklung/Test1.ps1
Normal file
78
knowlegbase/XML Händling/Entwicklung/Test1.ps1
Normal file
@@ -0,0 +1,78 @@
|
||||
cls
|
||||
|
||||
Set-Variable -Name ExportPfad -Value "E:\DB-XML-Test"
|
||||
Set-Variable -Name XMLVorlage -Value "E:\DB-XML-Test\Vorlage\vetra_luis_in.xml"
|
||||
Set-Variable -Name ZeitStempel1 -Value $(get-date -format yyyy-MM-ddTHH:mm)
|
||||
|
||||
$SQLServer = "vm-10-7\mssqlserver_1" #use Server\Instance for named SQL instances!
|
||||
$SQLDBName = "IID"
|
||||
$SqlQuery1 = "SELECT TOP 1 TOURNR, TOURDATUM FROM VWWEB_TOURDATEN GROUP BY TOURNR, TOURDATUM ORDER BY TOURNR"
|
||||
$SqlQuery2 = $null
|
||||
$SqlQuery3 = $null
|
||||
$user = "digitaldata"
|
||||
$pwd = "ks7788b"
|
||||
|
||||
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
|
||||
$SqlConnection.ConnectionString = "Server = $SQLServer; ;uid=$user; pwd=$pwd; Database = $SQLDBName; Integrated Security = False"
|
||||
|
||||
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
|
||||
$SqlCmd.CommandText = $SqlQuery1
|
||||
$SqlCmd.Connection = $SqlConnection
|
||||
|
||||
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
|
||||
$SqlAdapter.SelectCommand = $SqlCmd
|
||||
|
||||
$DataSet = New-Object System.Data.DataSet
|
||||
|
||||
$SqlConnection.Open()
|
||||
$SqlAdapter.Fill($DataSet)
|
||||
$SqlConnection.Close()
|
||||
|
||||
# TB Zeile Spalte
|
||||
$DataSet.Tables[0].Rows[0][0] | Out-GridView
|
||||
#$DataSet.Tables[0].Rows[0][3] | Out-GridView
|
||||
#$DataSet.Tables[0].Rows[99]["EmpName1"] | Out-GridView
|
||||
#$DataSet.Tables[0] | Out-GridView
|
||||
|
||||
exit
|
||||
|
||||
$xml = New-Object XML
|
||||
Write-Host "Lese XML Vorlage ein: $XMLVorlage"
|
||||
$xml.Load("$XMLVorlage")
|
||||
|
||||
|
||||
Write-Host ""
|
||||
Write-host "----------------------------------------"
|
||||
$xmlversion = ($xml.tours.format).ToString()
|
||||
Write-Host "Ausgelesener XML Version: $xmlversion"
|
||||
write-host "----------------------------------------"
|
||||
|
||||
Write-Host ""
|
||||
write-host "----------------------------------------"
|
||||
$export_date = ($xml.tours.export_date).ToString()
|
||||
Write-Host "Ausgelesenes XML Datum: $export_date"
|
||||
Write-Host "Ersetzendes XML Datum: $Zeitstempel1"
|
||||
$xml.tours.export_date = ($xml.tours.export_date.Replace($export_date, $Zeitstempel1))
|
||||
write-host "----------------------------------------"
|
||||
|
||||
FOREACH ($Row in $DataSet.Tables[0].Rows)
|
||||
{
|
||||
Write-Host ""
|
||||
write-host "value is : $($Row[0])"
|
||||
$Tour = $($Row[0]).ToString().Trim()
|
||||
write-host $Tour
|
||||
write-host "value is : $($Row[1])"
|
||||
|
||||
#$newperson = $oldperson.Clone()
|
||||
#$newperson.name = "$varTest1"
|
||||
#$newperson.age = "30"
|
||||
#$newperson.id = "103"
|
||||
|
||||
#$xml.employees.AppendChild($newperson)
|
||||
|
||||
write-host "----------------------------------------"
|
||||
#$xml
|
||||
|
||||
$xml.Save("$ExportPfad\ExportTest.xml")
|
||||
|
||||
}
|
||||
17
knowlegbase/XML Händling/Entwicklung/Unbenannt2.ps1
Normal file
17
knowlegbase/XML Händling/Entwicklung/Unbenannt2.ps1
Normal file
@@ -0,0 +1,17 @@
|
||||
Set-Variable -Name ExportPfad -Value "E:\DB-XML-Test"
|
||||
Set-Variable -Name XMLVorlage -Value "E:\DB-XML-Test\Vorlage\vetra_luis_in.xml"
|
||||
Set-Variable -Name ZeitStempel1 -Value $(get-date -format yyyy-MM-ddTHH:mm)
|
||||
|
||||
$xml = New-Object XML
|
||||
|
||||
$club = $xml.CreateElement('club')
|
||||
$club.SetAttribute('name','barracas')
|
||||
$xml.clubs.AppendChild($club)
|
||||
|
||||
#$xml.CreateNode("testeintrag")
|
||||
|
||||
#$xml.testwert.AppendChild("testeintrag")
|
||||
|
||||
#$xml.testwert.knoten1 = "testeintrag"
|
||||
|
||||
$xml.Save("$ExportPfad\ExportTest1.xml")
|
||||
BIN
knowlegbase/XML Händling/Entwicklung/xml.sql
Normal file
BIN
knowlegbase/XML Händling/Entwicklung/xml.sql
Normal file
Binary file not shown.
65
knowlegbase/XML Händling/Entwicklung/xmldemo.ps1
Normal file
65
knowlegbase/XML Händling/Entwicklung/xmldemo.ps1
Normal file
@@ -0,0 +1,65 @@
|
||||
# this is where the document will be saved:
|
||||
$Path = "E:\DB-XML-Test\inventory.xml"
|
||||
|
||||
# get an XMLTextWriter to create the XML
|
||||
$XmlWriter = New-Object System.XMl.XmlTextWriter($Path,$Null)
|
||||
|
||||
# choose a pretty formatting:
|
||||
$xmlWriter.Formatting = 'Indented'
|
||||
$xmlWriter.Indentation = 1
|
||||
$XmlWriter.IndentChar = "`t"
|
||||
|
||||
# write the header
|
||||
$xmlWriter.WriteStartDocument()
|
||||
|
||||
# set XSL statements
|
||||
$xmlWriter.WriteProcessingInstruction("xml-stylesheet", "type='text/xsl' href='style.xsl'")
|
||||
|
||||
# create root element "machines" and add some attributes to it
|
||||
$XmlWriter.WriteComment('List of machines')
|
||||
$xmlWriter.WriteStartElement('Machines')
|
||||
$XmlWriter.WriteAttributeString('current', $true)
|
||||
$XmlWriter.WriteAttributeString('manager', 'Tobias')
|
||||
|
||||
# add a couple of random entries
|
||||
for($x=1; $x -le 10; $x++)
|
||||
{
|
||||
$server = 'Server{0:0000}' -f $x
|
||||
$ip = '{0}.{1}.{2}.{3}' -f (0..256 | Get-Random -Count 4)
|
||||
|
||||
$guid = [System.GUID]::NewGuid().ToString()
|
||||
|
||||
# each data set is called "machine", add a random attribute to it:
|
||||
$XmlWriter.WriteComment("$x. machine details")
|
||||
$xmlWriter.WriteStartElement('Machine')
|
||||
$XmlWriter.WriteAttributeString('test', (Get-Random))
|
||||
|
||||
# add three pieces of information:
|
||||
$xmlWriter.WriteElementString('Name',$server)
|
||||
$xmlWriter.WriteElementString('IP',$ip)
|
||||
$xmlWriter.WriteElementString('GUID',$guid)
|
||||
|
||||
# add a node with attributes and content:
|
||||
$XmlWriter.WriteStartElement('Information')
|
||||
$XmlWriter.WriteAttributeString('info1', 'some info')
|
||||
$XmlWriter.WriteAttributeString('info2', 'more info')
|
||||
$XmlWriter.WriteRaw('RawContent')
|
||||
$xmlWriter.WriteEndElement()
|
||||
|
||||
# add a node with CDATA section:
|
||||
$XmlWriter.WriteStartElement('CodeSegment')
|
||||
$XmlWriter.WriteAttributeString('info3', 'another attribute')
|
||||
$XmlWriter.WriteCData('this is untouched code and can contain special characters /\@<>')
|
||||
$xmlWriter.WriteEndElement()
|
||||
|
||||
# close the "machine" node:
|
||||
$xmlWriter.WriteEndElement()
|
||||
}
|
||||
|
||||
# close the "machines" node:
|
||||
$xmlWriter.WriteEndElement()
|
||||
|
||||
# finalize the document:
|
||||
$xmlWriter.WriteEndDocument()
|
||||
$xmlWriter.Flush()
|
||||
$xmlWriter.Close()
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://blogs.technet.com/b/jamesone/archive/2010/01/19/how-to-pretty-print-xml-from-powershell-and-output-utf-ansi-and-other-non-unicode-formats.aspx
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\lsqbvj9xEUEp8uNqYkH5nQ==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://pshscripts.blogspot.de/2008/12/write-rssstreamps1.html
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\Zw00NaugZH7UQTR57fbU1Q==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://stackoverflow.com/questions/6037761/powershell-parse-xml-and-save-changes
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\z+TZHN8++CRifhKNxoFCjg==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://www.heise.de/ix/artikel/Datenzugriff-506816.html
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\gCucmxo5lL3l_mucCHDfYw==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=https://gist.github.com/codebrane/2965778
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\y_QYD8p9AZPI3gqAiqt+pw==.ico
|
||||
IconIndex=0
|
||||
6
knowlegbase/XML Händling/Skript Out-DataTable.URL
Normal file
6
knowlegbase/XML Händling/Skript Out-DataTable.URL
Normal file
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://gallery.technet.microsoft.com/scriptcenter/4208a159-a52e-4b99-83d4-8048468d29dd
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\gi57gWPiOd3JoywvV4OB5A==.ico
|
||||
IconIndex=0
|
||||
33
knowlegbase/XML Händling/Unbenannt1.ps1
Normal file
33
knowlegbase/XML Händling/Unbenannt1.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
function Convert-DateString ([String]$Date, [String[]]$Format)
|
||||
{
|
||||
$result = New-Object DateTime
|
||||
|
||||
$convertible = [DateTime]::TryParseExact(
|
||||
$Date,
|
||||
$Format,
|
||||
[System.Globalization.CultureInfo]::InvariantCulture,
|
||||
[System.Globalization.DateTimeStyles]::None,
|
||||
[ref]$result)
|
||||
|
||||
if ($convertible) { $result }
|
||||
}
|
||||
|
||||
|
||||
|
||||
$var1 = "10/09/2008 00:00:00"
|
||||
#$var1 = "10/09/2008"
|
||||
[DateTime]$var3 = [DateTime]::ParseExact($var1,"dd\/MM\/yyyy HH:mm:ss", $null)
|
||||
|
||||
write-host
|
||||
#$test3 = ($var3.Year.ToString().Trim())
|
||||
#$test4 = ($var3.Day.ToString().Trim())
|
||||
|
||||
$var3.ToLongTimeString()
|
||||
$var3.ToUniversalTime()
|
||||
|
||||
Write-Host $var3
|
||||
|
||||
#write-host "$test3-$test4"
|
||||
|
||||
|
||||
#write-host ($var3.Year).ToString().TrimEnd()'-'($var3.month)'-'($var3.Day)
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://virtualengine.co.uk/2013/updating-and-writing-xml-files-with-powershell/?ModPagespeed=noscript
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\U1s5d9J8Zt__VDdbxW7+Pw==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://blogs.msdn.com/b/powershell/archive/2007/05/29/using-powershell-to-generate-xml-documents.aspx
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\Gz8uQL36cfvUapdxk62mcA==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://blogs.technet.com/b/chitpro-de/archive/2007/10/09/windows-powershell-in-der-praxis-xml-verarbeitung-von-jan-moser.aspx
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\R1cmfvX4E4XKUFwJsKf9zA==.ico
|
||||
IconIndex=0
|
||||
@@ -0,0 +1,6 @@
|
||||
[InternetShortcut]
|
||||
URL=http://powershell.com/cs/blogs/tobias/archive/2009/02/02/xml-part-2-write-add-and-change-xml-data.aspx
|
||||
IDList=
|
||||
HotKey=0
|
||||
IconFile=C:\Users\KammM\AppData\Local\Mozilla\Firefox\Profiles\xb7vdovo.default\shortcutCache\QwBow7dhLs1T4HNoOsaQ7w==.ico
|
||||
IconIndex=0
|
||||
49
knowlegbase/XML Händling/dbtest.ps1
Normal file
49
knowlegbase/XML Händling/dbtest.ps1
Normal file
@@ -0,0 +1,49 @@
|
||||
$SQLServer = "192.168.13.101" #use Server\Instance for named SQL instances!
|
||||
$SQLDBName = "CP2DD"
|
||||
$SqlQuery = "select top 1 * from lief"
|
||||
$user = "sa"
|
||||
$pwd = "dd"
|
||||
|
||||
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
|
||||
$SqlConnection.ConnectionString = "Server = $SQLServer; ;uid=$user; pwd=$pwd; Database = $SQLDBName; Integrated Security = False"
|
||||
|
||||
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
|
||||
$SqlCmd.CommandText = $SqlQuery
|
||||
$SqlCmd.Connection = $SqlConnection
|
||||
|
||||
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
|
||||
$SqlAdapter.SelectCommand = $SqlCmd
|
||||
|
||||
$DataSet = New-Object System.Data.DataSet
|
||||
|
||||
$SqlConnection.Open()
|
||||
$SqlAdapter.Fill($DataSet)
|
||||
$SqlConnection.Close()
|
||||
|
||||
$DataSet.Tables[0] | Out-GridView
|
||||
# $DataSet.Tables[0] | Export-CliXML e:\Test2.xml
|
||||
|
||||
$DataSet.Tables[0] | select liefname
|
||||
|
||||
#----------------------------X M L ------------------------#
|
||||
|
||||
$xml = New-Object XML
|
||||
$xml.Load("e:\Vorlage3.xml")
|
||||
#$xml
|
||||
|
||||
$oldperson = @($xml.employees.employee)[0]
|
||||
$oldperson
|
||||
|
||||
|
||||
|
||||
$newperson = $oldperson.Clone()
|
||||
$newperson.name = "Cofi"
|
||||
$newperson.age = "30"
|
||||
$newperson.id = "103"
|
||||
|
||||
$xml.employees.AppendChild($newperson)
|
||||
|
||||
write-host "---------------"
|
||||
$xml
|
||||
|
||||
$xml.Save("e:\Vorlage3.xml")
|
||||
73
knowlegbase/XML Händling/xmlausdbtest.ps1
Normal file
73
knowlegbase/XML Händling/xmlausdbtest.ps1
Normal file
@@ -0,0 +1,73 @@
|
||||
$SQLServer = "192.168.13.101" #use Server\Instance for named SQL instances!
|
||||
$SQLDBName = "CP2DD"
|
||||
$SqlQuery = "select top 1 * from lief"
|
||||
$user = "sa"
|
||||
$pwd = "dd"
|
||||
|
||||
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
|
||||
$SqlConnection.ConnectionString = "Server = $SQLServer; ;uid=$user; pwd=$pwd; Database = $SQLDBName; Integrated Security = False"
|
||||
|
||||
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
|
||||
$SqlCmd.CommandText = $SqlQuery
|
||||
$SqlCmd.Connection = $SqlConnection
|
||||
|
||||
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
|
||||
$SqlAdapter.SelectCommand = $SqlCmd
|
||||
|
||||
$DataSet = New-Object System.Data.DataSet
|
||||
|
||||
$SqlConnection.Open()
|
||||
$SqlAdapter.Fill($DataSet)
|
||||
$SqlConnection.Close()
|
||||
|
||||
$DataSet.Tables[0] | Out-GridView
|
||||
|
||||
#foreach ($Row in $DataSet.Tables[0].Rows)
|
||||
# {
|
||||
# write-host "value is : $($Row[1])"
|
||||
# }
|
||||
|
||||
|
||||
#write-host 'value is : '$i' '$($dataset.Tables[0].Rows[$i][0])
|
||||
|
||||
#$DataSet.Tables[0].Row[0] | Out-GridView
|
||||
# $DataSet.Tables[0] | Export-CliXML e:\Test2.xml
|
||||
|
||||
[string]$varTest1 = $DataSet.Tables[0].Rows[0][1]
|
||||
|
||||
Set-Variable -Name varTest1 -Value $varTest1.TrimStart()
|
||||
Set-Variable -Name varTest1 -Value $varTest1.TrimEnd()
|
||||
|
||||
write-host "SQL Ergebinis: $vartest1"
|
||||
|
||||
#----------------------------X M L -----------------------------#
|
||||
|
||||
$xml = New-Object XML
|
||||
$xml.Load("e:\Vorlage3.xml")
|
||||
#$xml
|
||||
|
||||
$oldperson = @($xml.employees.employee)[0]
|
||||
$oldperson
|
||||
|
||||
$newperson = $oldperson.Clone()
|
||||
$newperson.name = "$varTest1"
|
||||
$newperson.age = "30"
|
||||
$newperson.id = "103"
|
||||
|
||||
$xml.employees.AppendChild($newperson)
|
||||
|
||||
write-host "---------------"
|
||||
$xml
|
||||
|
||||
$xml.Save("e:\Vorlage4.xml")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Remove-Variable *xml* -Force
|
||||
Remove-Variable *person* -Force
|
||||
31
knowlegbase/XML Händling/xmltest.ps1
Normal file
31
knowlegbase/XML Händling/xmltest.ps1
Normal file
@@ -0,0 +1,31 @@
|
||||
#[void] remove-variable * | out-null
|
||||
|
||||
<#
|
||||
|
||||
[xml]$LISFile = get-content e:\vorlage1.xml
|
||||
|
||||
#Beispiel:
|
||||
$LISFile.tour.tour_date
|
||||
|
||||
#>
|
||||
|
||||
$xml = New-Object XML
|
||||
$xml.Load("e:\Vorlage3.xml")
|
||||
#$xml
|
||||
|
||||
$oldperson = @($xml.employees.employee)[0]
|
||||
$oldperson
|
||||
|
||||
|
||||
|
||||
$newperson = $oldperson.Clone()
|
||||
$newperson.name = "Cofi"
|
||||
$newperson.age = "30"
|
||||
$newperson.id = "103"
|
||||
|
||||
$xml.employees.AppendChild($newperson)
|
||||
|
||||
write-host "---------------"
|
||||
$xml
|
||||
|
||||
$xml.Save("e:\Vorlage3.xml")
|
||||
Reference in New Issue
Block a user