Muhammad Mashwani

//Muhammad Mashwani
Muhammad Mashwani

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 116 total)
  • Author
    Posts
  • Muhammad Mashwani
    Keymaster
    Post count: 118

    It should probably be \n instead of `n.

    Also, try this: [Environment]::NewLine
    https://msdn.microsoft.com/en-us/library/system.environment.newline(v=vs.110).aspx

  • Muhammad Mashwani
    Keymaster
    Post count: 118
    in reply to: Test-Ping Function #1079

    The problem is with WordPress. The WordPress bbPress plugin used to do the forums uses the back tick to denote a code block. Since backtick is actually part of the PowerShell language, it messes up PowerShell code. The only way to post PowerShell code properly would be to replace all instances of the backtick with the HTML character that codes for it. I’m looking at migrating to something else because it’s getting on my nerves as well.

  • Muhammad Mashwani
    Keymaster
    Post count: 118
    in reply to: Test-Ping Function #1078

    The problem is with WordPress. The WordPress bbPress plugin used to do the forums uses the back tick to denote a code block. Since backtick is actually part of the PowerShell language, it messes up PowerShell code. The only way to post PowerShell code properly would be to replace all instances of the backtick with the HTML character that codes for it. I’m looking at migrating to something else because it’s getting on my nerves as well.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Like Aman suggested above, do something like this:
    $ReturnCode = Execute-Process -IgnoreExitCodes ‘129’ -PassThru
    If ($ReturnCode.ExitCode -eq 129) {
    Exit-Script -ExitCode 3010
    }

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Just call this function to unblock:
    Unblock-AppExecution

    Then call this function again to block:
    Block-AppExecution -ProcessName (excel,groove,onenote,infopath,onenote,outlook,mspub,powerpnt,winword,winproj,visio,communicator,lync,processexplorer)

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Just FYI, the toolkit also has a function called Get-PEFileArchitecture that will return this information.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Thanks, the Hungarian updates have been integrated.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    When you use the command prompt to execute the setx command, the %path% variable is interpreted by the command prompt (cmd.exe) not by setx.exe.

    In the PowerShell command, you are executing setx.exe and passing it a %path% variable it does not understand.

    To get the same results, you would need to execute cmd.exe instead of setx.exe.

    I would suggest a PowerShell method for changing the path environment variable:
    [Environment]::SetEnvironmentVariable(‘Path’, $env:Path + “;C:\test2222”, [EnvironmentVariableTarget]::Machine)

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    What does the log file say when you run the command? That will give use some more details on how the function processed the command.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Yeah, that was incorrect in the documentation. I’ve already updated the documentation for the 3.6.8 beta.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    PowerShell interprets a forward slash as a path separator. You will need to do something like this to write a forward slash to the registry:

    $HKCURegistrySettings = {
    Set-RegistryKey -Key “HKCU\Software\X\https:$([char]0x2F)$([char]0x2F)google.com$([char]0x2F)” -SID $UserProfile.SID
    }

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    I updated the documentation to include the names of the schedule IDs.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Yes, such a function is already in the toolkit. It is called Invoke-SCCMTask.

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Hey Ben,

    Let us know whenever you have the translations.

    Thanks,
    Mo

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    Thanks for reporting that. I updated the incorrect example in the documentation and the comments for the function.

    Execute-Process -Path 'setup.exe' -Parameters "/s /v"ALLUSERS=1 /qn /L* \"$configToolkitLogDir\$installName.log"""
    < \pre>
Viewing 15 posts - 1 through 15 (of 116 total)