Manage PlItems

You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.

Advanced Search
Displaying 21-30 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
278PowerShellFilehandlingPrüfen ob Verzeichnis existiert$myFolder = "C:\TEMP" if ((Test-Path $myFolder) -eq $true) { write-host "Folder exists!" } else { write-host "Folder doesn't exist!" }View Update Delete
282PowerShellDatum, ZeitGestriges Datum$d=(Get-Date).AddDays(-1) $output=Get-Date $d -format "yyyy-MM-dd" # 2014-02-27 View Update Delete
227PowerShellSysteminfoHostnamen ermitteln$myHostname = [system.environment]::MachineName; write-host $myHostname; # prints MyComputer1 or srvWindows2View Update Delete
228PowerShellStringsReplace$str1 = "abc#def"; $str1 = $str1.Replace("#",";"); write-host $str1; # Output: abc;defView Update Delete
229PowerShellStringsString nach einem Teilstring durchsuchen# See also a good hint with explanation between like and contains: # http://windowsitpro.com/blog/powershell-contains $fullstring = "This is my string"; if ($fullstring -like "*my*") { Write-Host "found" -ForegroundColor Green; } else { Write-Host "nope" -ForegroundColor Red; }View Update Delete
234PowerShellDatum, ZeitAktuelles Datum/Uhrzeit $myDate=Get-Date -format "yyyy-MM-dd hh:mm"; write-host $myDate -Foregroundcolor Cyan; # 2014-01-14 10:15 # Maybe AM or PM # For 24h Version $myDate=Get-Date -format "yyyy-MM-dd HH:mm"; write-host $myDate -Foregroundcolor Cyan; # 2014-01-14 22:15View Update Delete
248PowerShellFallunterscheidungTernary operator## Example from here: https://www.kongsli.net/2012/02/23/powershell-another-alternative-to-ternary-operator/ $thisVar='OK' $resultVar = @{$true=1;$false=2}[$thisVar -eq 'OK'] // same as if-else construction if ($thisVar -eq 'OK') { $resultVar = 1; } else { $resultVar = 2; }View Update Delete
254PowerShellFilehandlingAlle Dateien aus Verzeichnis auslesen$CSVFullPath = "C:\Temp" $FileFilter = "*.csv" $ListOfFiles = (Get-ChildItem -Path $CSVFullPath -Filter $FileFilter) | Select Name, BaseName, DirectoryName, FullName, Extension $ListOfFiles.Name View Update Delete
255PowerShellFilehandlingVerzeichnis rekursiv durchsuchen$CSVFullPath = "C:\Temp" $FileFilter = "*.*" $ListOfFiles = (Get-ChildItem -Path $CSVFullPath -Filter $FileFilter -Recurse) | Select Name, BaseName, DirectoryName, FullName, Extension | Where {$_.DirectoryName -like "*not_processed*" } $ListOfFiles.FullNameView Update Delete
216ORACLE PL/SQLDatum, ZeitAktuelles Datum/Uhrzeit-- if todays date is: 2014-02-02 then a static query would be SELECT TO_DATE('02/02/2014','dd/mm/yyyy') FROM dual -- system variable SELECT SYSDATE AS TODAY FROM SYS."DUAL"View Update Delete