Code Monkey home page Code Monkey logo

microsoft's People

Contributors

guyrleech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microsoft's Issues

Trimmer: The term 'False' is not recognized as the name of a cmdlet

Hi,
first, thanks for this script.
I have tried it now and get the following error when I run Trim idle task:
`
False : The term 'False' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • False
  •   + CategoryInfo          : ObjectNotFound: (False:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

False : The term 'False' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1

  • False
  •   + CategoryInfo          : ObjectNotFound: (False:String) [], CommandNotFou
     ndException
      + FullyQualifiedErrorId : CommandNotFoundException
    

Task is calling this:powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\TEMP\Trimmer.ps1 -ThisSession -scheduled -Idle 600 -background -above 10485760 -available False -logfile C:\TEMP\MemoryOptimization.log -processes firefox,iexplore`

Transscript:
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT TotalPhysicalMemory FROM Win32_ComputerSystem,'queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: Operation 'Query CimInstances' complete.
VERBOSE: Available memory is 5797MB out of 8191MB total (71%)
False : The term 'False' is not recognized as the name of a cmdlet, function, script file, or operable program. Check 
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ False
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (False:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
False : The term 'False' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ False
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (False:String) [], CommandNotFou
   ndException
    + FullyQualifiedErrorId : CommandNotFoundException

VERBOSE: Not trimming as memory available is above specified threshold

License

Hi Guy,

I'm interested in using some of the code in this repo but there's no license. Would you be willing to apply a license?

Thanks,

Travis

Trimmer: Parameter -Processes seems to do nothing

Using -Processes firefox,iexplore seems to do not optimize Memory for these processes.
If I remove the Processes parameter it works well.

powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\TEMP\Trimmer.ps1 -ThisSession -scheduled -above 10485760 -logfile C:\TEMP\MemoryOptimization.log -Processes "firefox","iexplore" -Verbose

Verbose Logging:

VERBOSE: 	Skipping firefox pid 7868 as not specified process
VERBOSE: 	Skipping iexplore pid 2128 as not specified process
VERBOSE: 	Skipping iexplore pid 4528 as not specified process
VERBOSE: 	Skipping iexplore pid 8540 as not specified process
VERBOSE: 	Skipping iexplore pid 8608 as not specified process

It seems that you are trying to compare to $process.Name but it should be $process.ProcessName and if you put this $processes = $processes.Split(",") before Get-Process routine it works.

To speed up Get-Process I would supply $processes with parameter Name if processes are present, it should be faster...

show users.ps1 Datetime conversion

Hello,

once again thanx for sharing.

I have to comment on an error i am receiving:
"Exception calling "ToDateTime" with "1" argument(s): "Specified argument was out of the range of valid values. (Parameter 'dmtfDate')""

With the CIM cmdlets, you don't need to manually convert DateTimes:

(Get-CimInstance Win32_OperatingSystem -computername $using:Server).LastBootUpTime
Will just be a standard DateTime object now.

so

line 201: [string]$rawBootTime = Get-CimInstance -Class Win32_OperatingSystem -ComputerName $machineName -ErrorAction SilentlyContinue | Select-Object -ExpandProperty LastBootUpTime

should now become :

$rawBootTime = (Get-CimInstance -Class Win32_OperatingSystem -ComputerName $machineName -ErrorAction SilentlyContinue).LastBootUpTime

and

line 204: $bootTime = [Management.ManagementDateTimeConverter]::ToDateTime( $rawBootTime )

should become :

$bootTime = $rawBootTime

show users.ps1 Get-WmiObject is not recognised

Hello,

great work. I have to comment on an error i am getting.
"The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program."

The cmdlet get-ciminstance could be used instead. Just find and replace the "get-wmiobject" with "get-ciminstance" in the code and it works like a charm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.