Sveučilište u Zagrebu  |  Filozofski fakultet  |  Služba za informatiku  |  links

Kutak za korisnike




Savjeti za rad s Windowsima, Office-om i sve ostalo....

character tables EXCEL Outlook SQL *[iu]x PowerShell
  • elevated powershell from WSL:
    powershell.exe -Command "Start-Process powershell -Verb RunAs"
  • Ensure that script is run by an elevated powershell process
    #include the following Requires comment line at the start of the script
    #Requires -RunAsAdministrator
  • Execute a command in a string
    $cmd = "dir *.ps1"
    Invoke-Expression $cmd
  • Convert a string of commands into a scriptblock
    $cmd = @"
       a multiline set of commands
    $scriptBlock = [Scriptblock]::Create($cmd)
    Invoke-Command -ScriptBlock $scriptBlock
  • PowerShell scheduled job # from an Administrator PowerShell
    $trigger = New-JobTrigger -Once -At ((Get-Date).AddSeconds(5)) -RepeatIndefinitely -RepetitionInterval (New-TimeSpan -Minutes 1)
    Register-ScheduledJob -Name "EveryMinuter" -Trigger $trigger -ScriptBlock { whoami }
    # Get-Job, Receive-Job, Remove-Job, Unregister-ScheduledJob
  • Change local user password
    $Password = Read-Host -AsSecureString -Prompt "Enter new password"
    Get-LocalUser -Name <username> | Set-LocalUser -Password $Password
  • Inspect the MS SQL Server database
    sqlps -noexit -command cd sql/<machineName>/<instanceName>/databases
    dir <databaseName>/tables | foreach { $_.Script() }
    dir <databaseName>/storedProcedures | foreach { $_.Script() }
    dir <databaseName>/tables/dbo.<tableName>/columns |
      foreach {
        "Column: $($ $($_.datatype.SqlDataType) $($_.datatype.MaximumLength) $($_.Nullable)"
  • Get Target Path from Shortcuts
  • Securng Passwords
  • Invoke-WebRequest cmdlet in PowerShell
  • Prebroj programske linije
  • Find PDF files with 'python' in the name (case insensitive)
    Get-ChildItem c:\,d:\ -Recurse -ErrorAction SilentlyContinue | where name -like "*python*pdf"
Git Markdown Pandoc Cartificates Web Ostalo


Referentni materijali:



komentare molim ovdje